Menu
Index

Contact
LinkedIn
GitHub
Atom Feed
Comments Atom Feed



Tweet

Similar Articles

31/10/2009 11:03
Linux (Debian, Ubuntu) SNMP basics
04/10/2011 10:31
ICMP Connectivity Monitoring with Cacti
15/06/2011 09:34
Universal Log Analyser and snmpd extension scripts
31/10/2009 14:46
SMART stats on Cacti (via SNMP)
26/04/2012 16:59
MySQL Performance Graphs on Cacti via SNMP
16/10/2012 20:07
iostat on Cacti via SNMP

Recent Articles

17/07/2016 15:23
AWS ssh known_host sync
11/07/2016 08:42
File integrity and log anomaly auditing Updated (like fcheck/logcheck)
30/05/2016 13:09
Xenial LXC Container on Debian
12/03/2016 15:33
PHP Zend opcache on Cacti via SNMP
11/03/2016 13:11
Git on (Smart) HTTP with read/write authentication

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
extend ntpjitter /etc/snmp/ntp-stats 10

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.

Download: snmpd extension script and Cacti Templates on GitHub

Restart snmpd and you should be able to query the new OIDs.

Cacti

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:

Cacti NTP Jitter over SNMP

Cacti NTP Offset over SNMP

 

Comments:

Aloras Image  04/05/2015 12:01 :: Aloras

The XML raises an xml parse Error on cacti 0.8.8b.

Aloras Image  04/05/2015 12:21 :: Aloras

The Templates work fine

Tom O'Neil Image  28/08/2015 16:41 :: Tom O'Neil

Also having problem with this xml file importing correctly

Glen Pitt-Pladdy Image  28/08/2015 18:56 :: Glen Pitt-Pladdy

What errors are you getting? Also see my hack for older versions of Cacti, however if that's applicable to you then it's much better you just keep your Cacti up to date. There are lots of fixes being added and have been some security problems as well in the recent past so always best to keep with a current/supported version.

Joe Image  10/09/2015 18:40 :: Joe

I made a typo in the script, then accidentally ran it without throwing any switches at it and it laughed at me:

joe@USALAB8:~$ ./ntp-stats
(standard_in) 1: syntax error
(standard_in) 1: illegal character: L
(standard_in) 1: illegal character: O
(standard_in) 1: illegal character: L
(standard_in) 1: syntax error

Anyway, it works now. Thanks.




Are you human? (reduces spam)
Note: Identity details will be stored in a cookie. Posts may not appear immediately