prometheus监控之pdns

1.pdns-exporter项目地址(感谢作者提供,记得star _支持下)

地址:https://github.com/wrouesnel/pdns_exporter

2.安装pdns-exporter

wget https://github.com/wrouesnel/pdns_exporter/releases/download/v0.0.3/pdns_exporter.x86_64
sudo mv pdns_exporter.x86_64 /usr/bin/
chmpd +x /usr/bin/pdns_exporter.x86_64

3.加入Unit服务

# cat  /usr/lib/systemd/system/pdns_exporter.service
[Unit]
Description=pdns_recursor Exporter
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/pdns_exporter.x86_64 -collector.powerdns.socket=recursor:unixgram:/run/pdns_recursor.controlsocket
ExecReload=/bin/kill -HUP
KillMode=process
TimeoutStopSec=20s
Restart=always

[Install]
WantedBy=default.target

4.加入开机自启和启动服务

sudo systemctl daemon-reload
sudo systemctl enable pdns_exporter.service
sudo systemctl start pdns_exporter.service

5.检查服务启动状态和端口

# netstat -antp|grep 9120
tcp6       0      0 :::9120                 :::*                    LISTEN      42139/keepalived-ex

6.查看监控数据

# curl -s  http://localhost:9120/metrics|grep process|grep -v '#'
process_cpu_seconds_total 0.44
process_max_fds 1024
process_open_fds 9
process_resident_memory_bytes 1.0215424e+07
process_start_time_seconds 1.66936377934e+09
process_virtual_memory_bytes 1.6510976e+07

7.报警rules


Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐