#influx-db #monitoring #telemetry #pihole

app pihole-influx-agent

将PiHole指标发布到InfluxDB。支持Influx的V2 API。

1个不稳定版本

0.1.1 2022年1月23日
0.1.0 2022年1月23日

#375 in 可视化

AGPL-3.0-only

130KB
271 代码行

PiHole Influx Agent


直接将PiHole指标推送到Influx DB。支持Influx DB V2 API。

用法

构建
  • 使用 cargo 安装: cargo install pihole-influx-agent; 或者
  • 从发布页面下载适用于您架构的版本; 或者
  • 克隆项目并使用 cargo build --release 编译
运行
$ pihole-influx-agent --help
pihole-influx-agent 0.1.0

USAGE:
    pihole-influx-agent [FLAGS] [OPTIONS] <pihole-hostname> <influx-db-host> <influx-db-token> <influx-db-bucket> <influx-db-org-id>

FLAGS:
    -h, --help               Prints help information
        --influx-https
        --influx-insecure
        --pihole-https
        --pihole-insecure
    -V, --version            Prints version information

OPTIONS:
    -i, --interval-seconds <interval-seconds>     [default: 30]

ARGS:
    <pihole-hostname>      [env: PIHOLE_HOSTNAME=]
    <influx-db-host>       [env: INFLUX_DB_HOST=]
    <influx-db-token>      [env: INFLUX_DB_TOKEN=]
    <influx-db-bucket>     [env: INFLUX_DB_BUCKET=]
    <influx-db-org-id>     [env: INFLUX_DB_ORG_ID=]

$ RUST_LOG=info PIHOLE_HOSTNAME=<host> INFLUX_DB_HOST=<host> INFLUX_DB_TOKEN=<token> INFLUX_DB_ORG_ID=<org-id> INFLUX_DB_BUCKET=<bucket> ./target/debug/pihole-influx-agent --influx-insecure --influx-https
[2022-01-15T14:01:44Z INFO  pihole_influx_agent] Received summary from PiHole: 32457 domains blocked today

日志可以通过 RUST_LOG 环境变量 控制

仪表板
  1. 使用 template.json 添加仪表板到InfluxDB UI。
  2. 从下拉列表中选择存储桶名称。

依赖项

~11–25MB
~380K SLoC