Files
Distributed-Prometheus/edge-agent/onvif-exporter/README.md
Super User 95a09fd9d8 完善中央与边缘部署、远程写入与监控文档
- 增加中央与边缘完整配置和部署脚本
- 引入 VictoriaMetrics 数据源与 remote_write 故障排查说明
- 新增 edge-agent 配置脚本、ONVIF 自建 exporter 与 ping 监控示例

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-25 04:24:40 -05:00

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ONVIF Exporter自建
本目录为自建的 ONVIF 探测容器,供边缘节点可选使用。通过 ONVIF `GetDeviceInformation` 探测设备是否在线,并暴露 Prometheus 指标。
## 指标
- `onvif_device_up`1=可达0=不可达标签instance, location, model, device_type
- `onvif_probe_duration_seconds`:探测耗时(秒)
## 配置
-**config/onvif-targets.json** 读取设备列表(与 `targets.csv` 中 onvif 行一致,由 `config/update-configs.sh` 生成)。
- 环境变量:`TARGETS_FILE`(默认 `/config/targets.json`)、`EXPORTER_PORT`(默认 9600
## 构建与运行
在边缘节点目录下启用 ONVIF 并构建、启动:
```bash
cd edge-agent
docker compose --profile onvif up -d --build
```
或仅构建镜像:
```bash
docker build -t onvif-exporter:local ./onvif-exporter
```
## 依赖
- Go 1.21仅构建时需要Dockerfile 内已包含)
- [github.com/use-go/onvif](https://github.com/use-go/onvif)ONVIF 协议)
- [prometheus/client_golang](https://github.com/prometheus/client_golang)(指标暴露)