Page 1 of 1
NTP Monitoring
Posted: Fri May 10, 2019 11:03 am
by progressive.nagiosXI
Hi ,
One of our client want to enable NTP monitoring for all servers i.e. if any of the server’s time will not sync with Company Time server then they will get an alert.
Please let us know is this possible via SNMP or any other way ,if possible
what all information is required from their end, this needs to be implemented on priority.
Currently we are monitoring their servers via SNMP .
Servers need to monitor are Windows,Linux,HP-UX
Thanks
Re: NTP Monitoring
Posted: Fri May 10, 2019 1:29 pm
by cdienger
I don't think it's doable via snmp, but you could use an NRPE agent to run the check_ntp_time plugin on the *nix machines and an external script on the Windows machines.
For Windows you'll need to install nsclient++, install a plugin that checks the time, and configure the client to run the script:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://exchange.nagios.org/index.php?o ... chword=ntp
https://support.nagios.com/kb/article.php?id=528
We have NRPE agents for a lot of Linux platforms:
https://support.nagios.com/kb/article/n ... rpe-8.html
HP-UX may be a bit trickier as it needs to be compiled. See:
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
Re: NTP Monitoring
Posted: Sat May 11, 2019 9:44 am
by progressive.nagiosXI
Hi ,
we currently monitor HP-UX with NRPE and window and linux with SNMP ,
we tested below plugins in our Nagiosxi server and give NTP server IP address
check_ntp_server_sync.sh(give some error in script)
check_ntp_time.pl (not giving any output)
Please give some working plugins details ,also let us know can we run same plugins via NCPA as it gives auto discovery feature for disks and easy to install on windows and linux.
Thanks
Re: NTP Monitoring
Posted: Mon May 13, 2019 10:37 am
by cdienger
For the *nix machines I would recommend using the check_ntp_time plugin which are a part of the plugins -
https://nagios-plugins.org/downloads/. I can be tested on the XI machine with:
Code: Select all
/usr/local/nagios/libexec/check_ntp_time -H 0.north-america.pool.ntp.org -v
Note that NCPA doesn't install these plugins by default so you would need to install them and then copy them to the NCPA plugins' directory(usually /usr/local/ncpa/plugins). The check would then be executed from the XI machine with something like:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H ncpa_agent_ip -t '<your token>' -M 'plugins/check_ntp_time' -q 'args=-H 0.north-america.pool.ntp.org'
On a Windows system you can use
https://exchange.nagios.org/directory/P ... 29/details and then run it with something like:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H ncpa_agent_ip -t '<your token>' -M 'plugins/check_time.vbs' -q 'args=0.north-america.pool.ntp.org .25 .50'
Re: NTP Monitoring
Posted: Fri May 17, 2019 6:14 am
by progressive.nagiosXI
Hi,
warning and critical Threshold not work for windows.
For testing we increase and decrease server time 1 hour.
Server time : +1hour
NTP OK: Offset -3592.1846580 secs|'offset'=-3592.1846580s;.50;.60;
[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.80.0.189 -t 'Token' -M 'plugins/check_time.vbs' -q 'args=0.north-america.pool.ntp.org .50 .60 -v'
NTP OK: Offset -3592.1813437 secs|'offset'=-3592.1813437s;.50;.60;
[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.80.0.189 -t 'Token' -M 'plugins/check_time.vbs' -q 'args=0.north-america.pool.ntp.org .50 .60 -v'
Server time : -1hour
NTP OK: Offset +3611.9815976 secs|'offset'=+3611.9815976s;.50;.60;
You have mail in /var/spool/mail/root
[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.80.0.189 -t 'Token' -M 'plugins/check_time.vbs' -q 'args=0.north-america.pool.ntp.org .50 60 -v'
NTP OK: Offset +3611.9822431 secs|'offset'=+3611.9822431s;.50;60;
[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.80.0.189 -t 'Token' -M 'plugins/check_time.vbs' -q 'args=0.north-america.pool.ntp.org 50 60 -v'
NTP OK: Offset +3611.9860925 secs|'offset'=+3611.9860925s;50;60;
Re: NTP Monitoring
Posted: Fri May 17, 2019 9:42 am
by cdienger
Make the changes to the script that are mentioned in the comments:
1) SetLocale("en-us") should be added as mentioned above
2) Abs() should be used then comparing, around 75th line:
If result = "" Then
Err = 3
Status = "UNKNOWN"
ElseIf Abs(result) > Abs(crit) Then
Err = 2
status = "CRITICAL"
ElseIf Abs(result) > Abs(warn) Then
Err = 1
status = "WARNING"
Else
Err = 0
status = "OK"
End If
Re: NTP Monitoring
Posted: Fri May 17, 2019 12:31 pm
by progressive.nagiosXI
Thanks cdienger/Team ,
NTP successfully work on windows,linux and HP-UX
Re: NTP Monitoring
Posted: Fri May 17, 2019 1:06 pm
by cdienger
Glad to hear!