Howto disable the ntp collector on node_exporter
The purpose of this KB is to show you how to disable the ntp collector on the node_exporter systemctl service. NTP has been replaced by chrony since RHEL7/CentOS7 , which broke node_exporter ability to collect ntp related statistics with default configuration.
How to determine if you have this issue ?
Check journalctl for log events like these:
Oct 27 03:33:03 swarm-cg2 node_exporter: ts=2024-10-27T02:33:03.545Z caller=collector.go:169 level=error msg="collector failed" name=ntp duration_seconds=0.0001043 err="couldn't get SNTP reply: read udp 127.0.0.1:36050->127.0.0.1:123: read: connection refused"
Oct 27 03:33:33 swarm-cg2 node_exporter: ts=2024-10-27T02:33:33.552Z caller=collector.go:169 level=error msg="collector failed" name=ntp duration_seconds=7.7339e-05 err="couldn't get SNTP reply: read udp 127.0.0.1:38903->127.0.0.1:123: read: connection refused"
To fix this issue you need to edit /usr/lib/systemd/system/node_exporter.service and modify the following:
modify --ntp-collector flag to --no-ntp-collector
Final full line looks like this
ExecStart=/usr/local/bin/node_exporter --web.listen-address=:9100 --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$ --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker)($|/) --collector.filesystem.ignored-fs-types=^/(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)($|/) --collector.meminfo_numa --collector.ntp --collector.processes --collector.tcpstat --no-collector.nfs --no-collector.nfsd --no-collector.xfs --no-collector.zfs --no-collector.infiniband --no-collector.vmstat --no-collector.textfile --collector.conntrack --collector.qdisc --collector.netclass
To activate the change do
systemctl daemon-reload
systemctl restart node_exporter
Repeat this for every server where node_exporter service is running on.
, multiple selections available,
© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.