https://github.com/SuperQ/chrony_exporter
https://linuxhit.com/prometheus-node-ex ... o-install/
Code: Select all
wget https://github.com/SuperQ/chrony_exporter/releases/download/v0.12.1/chrony_exporter-0.12.1.linux-arm64.tar.gz Code: Select all
tar -xvzf chrony_exporter-0.12.1.linux-arm64.tar.gzCode: Select all
cd chrony_exporter-0.12.1.linux-arm64Code: Select all
sudo mv chrony_exporter /usr/local/binCode: Select all
[Unit]
Description=Chrony Exporter
After=network.target
[Service]
ExecStart=/usr/local/bin/chrony_exporter \
--web.listen-address=:9123 \
--collector.sources \
--collector.serverstats \
--collector.chmod-socket \
--chrony.address=unix:///run/chrony/chronyd.sock
Restart=always
User=root
[Install]
WantedBy=multi-user.target
Code: Select all
sudo systemctl daemon-reloadCode: Select all
sudo systemctl enable chrony_exporterCode: Select all
sudo systemctl start chrony_exporterCode: Select all
systemctl status chrony_exporterCode: Select all
- job_name: 'chrony_exporter'
static_configs:
- targets: ['localhost:9123'] # or use the host IP/hostname
Code: Select all
rule_files:
- /etc/prometheus/rules/*.yml
Code: Select all
sudo mkdir -p /etc/prometheus/rulesCode: Select all
groups:
- name: Chrony
rules:
- record: instance:chrony_clock_error_seconds:abs
expr: >
abs(chrony_tracking_last_offset_seconds)
+
chrony_tracking_root_dispersion_seconds
+
(0.5 * chrony_tracking_root_delay_seconds)
Code: Select all
promtool check config /etc/prometheus/prometheus.ymlCode: Select all
sudo systemctl restart prometheus