Glen Pitt-Pladdy :: Blog
NTP Monitoring on Cacti over SNMP
Yet another Cacti & SNMP article based on the approaches described in my original SNMP article.
This time looking at NTP, something seldom monitored, but these days becoming increasingly important to ensure that you have a quality sync. In many cases NTP goes un-monitored and people only realize there is a problem when applications that depend on it break, but you can take action long before anything fails.
I'm not going to cover configuration of ntpd - out the box it should be working with most distros and about all you may want to do is add a local "preferred" server (possibly removing public ones).
Collecting data & snmpd Extensions
When you have ntpd running you can query it with the ntpq command in various ways and that's pretty much all I do for this one. You will need to add in the extension script in /etc/snmp/snmpd.conf as follows:
extend ntpoffset /etc/snmp/ntp-stats 9
The number in this case is just the column number of the output of ntpq to harvest.
Grab the extension script ntp-stats below and put it in an appropriate place (I use /etc/snmp/), adjusting the config above to match.
Restart snmpd and you should be able to query the new OIDs.
Then you need to import the Cacti template cacti_host_template_ntp_monitor.xml to go with these and create the graphs in Cacti.
The graphs look like this:
Copyright Glen Pitt-Pladdy 2008-2017