Files
Distributed-Prometheus/edge-agent/onvif-exporter
User 650e5145f1 refactor: 边缘节点与配置精简
- 边缘: Prometheus 改为 vmagent,统一 docker-compose.yml,内存+磁盘缓存
- 边缘脚本: 合并为 deploy.sh [--local],删除 run-edge-local、quick-setup、run-edge-with-cache
- 配置: 合并为 update-configs.sh,统一 targets.csv,生成 target-onvif/target-ping/target-topology
- 删除 topology-editor、旧格式 devices.csv/ping-targets.csv、setup-remote-write、test-connection
- 文档: 更新 EDGE_CACHE、TIANDITU(瓦片改 4090 直连 tile-cache)

Made-with: Cursor
2026-02-28 19:44:46 -05:00
..

ONVIF Exporter自建

本目录为自建的 ONVIF 探测容器,供边缘节点可选使用。通过 ONVIF GetDeviceInformation 探测设备是否在线,并暴露 Prometheus 指标。

指标

  • onvif_device_up1=可达0=不可达
    • 标签:instance, location, model, device_type, lat, lon
  • onvif_probe_duration_seconds:探测耗时(秒)
    • 标签同上

配置

  • config/target-onvif.json 读取设备列表(与 targets.csv 中 onvif 行一致,由 config/update-configs.sh 生成)。
    • 支持字段:device_type, model, location, username, password, onvif_port, lat, lon
  • 环境变量:TARGETS_FILE(默认 /config/targets.json)、EXPORTER_PORT(默认 9600

构建与运行

在边缘节点目录下启用 ONVIF 并构建、启动:

cd edge-agent
docker compose --profile onvif up -d --build

或仅构建镜像:

docker build -t onvif-exporter:local ./onvif-exporter

依赖