NTP sync on Windows and Linux hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

NTP sync on Windows and Linux hosts

Post by psasines »

Hi,

We need some support on the monitoring of time difference between our NTP server and Windows and Linux hosts.
I already used the check_np_time(checks with NAGIOS Srv) and chack_daytime.
Thank you for your help.

Best Regards,
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NTP sync on Windows and Linux hosts

Post by cdienger »

Are you having a specific problem or need help with implementing it a certain way? The default plugins come with ntp plugins and there are ntp plugins for the Windows OS on the exchange:

http://nagios-plugins.org/doc/man/index.html
https://exchange.nagios.org/index.php?o ... %20windows
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: NTP sync on Windows and Linux hosts

Post by psasines »

Hello,

I created a command for check_ntp_time
$USER1$/check_ntp_time -H $ARG1$ -w $ARG2$ -c $ARG3$

$ARG1$ our NTPserver

And put the service on windows 10 computer with 90 seconds delay and the result is:

NTP OK: Offset 0.0003350973129 secs

Best regards
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NTP sync on Windows and Linux hosts

Post by cdienger »

That looks like a good response. Are there any problems or can we consider this thread closed?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: NTP sync on Windows and Linux hosts

Post by psasines »

i'm sorry but this not a good response.
If the host(windows computer) is not sync the response has to be "critical" not ok.

No matter the host(windows computer) time the response is always the same.
So this is NOT working fine.
NTP OK: Offset 0.0003350973129 secs - NOT the CORRECT response
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: NTP sync on Windows and Linux hosts

Post by mcapra »

psasines wrote: And put the service on windows 10 computer with 90 seconds delay and the result is:
Could you expand more on exactly what you did here?

All check_ntp_time does is, from the machine on which it is run, compare the local time to what the NTP server (provided with -H) reports:

Code: Select all

This plugin checks the clock offset between the local host and a
remote NTP server. It is independent of any commandline programs or
external libraries.
If you're executing check_ntp_time from the Nagios XI machine, it has no concept of anything happening on a remote Windows machine. This plugin was designed to be executed on the host that you wish you check times on.

If you would like Nagios Core to be responsible for monitoring NTP offsets on a particular remote machine, you'd typically be leveraging an agent (like NSClient++ or NCPA) to handle those "remote executions". What (if any) agent are you currently using on the remote Windows 10 machine?

This thread has a similar use case and implementation, in which case the agent being used is NSClient++ to execute commands on the remote Windows machine:
https://support.nagios.com/forum/viewto ... =7&t=39227
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NTP sync on Windows and Linux hosts

Post by cdienger »

Thanks for clarifying, @mcapra!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: NTP sync on Windows and Linux hosts

Post by psasines »

Thank you for your help.

I implemented this on my Windows Hosts

$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_windows_time
And changed the nsclient.ini to get the arguments for hte check_windows_time.vbs script.
IT's OK.

Now i need to make some similar with the Linux hosts, i'm tryng to configure the native NAGIOS XI plugin check_ntp_time:
$USER1$/check_ntp_time -H $ARG1$ -w $ARG2$ -c $ARG3$

Do i have to copy the file to the linux hosts? And where to?
Tank you.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NTP sync on Windows and Linux hosts

Post by cdienger »

check_ntp_time is a part of the default plugins and should be installed when the agent is installed - https://support.nagios.com/kb/article/n ... rpe-8.html. Once the agent is installed you would need to edit nrpe.cfg to include a line like:

command[check_ntp_time]=/usr/local/nagios/libexec/check_ntp_time -H pool.ntp.org

(replacing pool.ntp.org) with whatever ntp server you wanted to check against.

After restarting the agent to load the new command, the command can be run from the XI machine using check_nrpe again:

/usr/local/nagios/libexec/check_nrpe -H remote_linux_machine_ip -c check_ntp_time
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked