Monitoring for NTP in windows OS

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Monitoring for NTP in windows OS

Post by Uday Kumar »

Hi Team,

Is it possible to monitor NTP configuration in windows.
IF so ,can you please provide us the plugin and steps to define commands and requirements from server end.

If anything else need from my end please let me know.

Thanks & Regards
Uday.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring for NTP in windows OS

Post by Box293 »

This plugin on the Nagios exchange should be what you are after:

https://exchange.nagios.org/directory/P ... 29/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Monitoring for NTP in windows OS

Post by Uday Kumar »

Hi,

As per the link you provided, we have done all the required changes in Nagios server and remote host as well.

When we tried to test the check, locally in remote host we are facing the below attached error.

Can you please help me to sort out this.

Regards
B Uday Kumar
Attachments
Error we are facing while executing script locally in remote machine.
Error we are facing while executing script locally in remote machine.
Error.PNG (4.17 KiB) Viewed 5429 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring for NTP in windows OS

Post by Box293 »

I tested this and I found I got the same error when I provided an invalid IP address. When the IP address I provided was able to be contacted it worked OK. Check your firewall to see if the NTP ports are open.

From looking at the script, here is the command the script executes:
Selection_102.png
Selection_102.png (5.55 KiB) Viewed 5426 times
You can see the second attempt is to an unreachable address.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Monitoring for NTP in windows OS

Post by Uday Kumar »

i have tested the NTP port and the command line.
Everything looks fine and executing correctly.

But sill getting same error as earlier when checking the script locally from Remote host.

And in Nagios server we are getting the below error while executing command.

#./check_nrpe -H XXXXXX -c check_ntp_time
No handler for command: check_ntp_time
Attachments
NTP Execution.
NTP Execution.
NTP.PNG (3.45 KiB) Viewed 5425 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring for NTP in windows OS

Post by rkennedy »

You'll need to add the command for check_ntp_time to your nsclient.ini file.

Under the section labeled [/settings/external scripts/scripts] in nsclient.ini, add this below -

Code: Select all

command[check_ntp_time]=cscript.exe //T:30 //NoLogo check_time.vbs server1,server2,server3 20 240
Then, restart the NSClient++ (nscp) service, and try once again.
Former Nagios Employee
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Monitoring for NTP in windows OS

Post by Uday Kumar »

Hi Kennedy,

I have added the line in nsclient.ini file and restarted.

But still getting same error.

# ./check_nrpe -H XXXXXXXXXX -c check_ntp_time
No handler for command: check_ntp_time
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring for NTP in windows OS

Post by Box293 »

Please post your nsclient.ini file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Monitoring for NTP in windows OS

Post by Uday Kumar »

Hi ,

Please find the attached nsclient file.
Attachments
nsclient.txt
(8.95 KiB) Downloaded 249 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitoring for NTP in windows OS

Post by tgriep »

Thanks for the INI file. The example on the Exchange Site isn't correct so if you edit the nsclient.ini file and change this line from

Code: Select all

command[check_ntp_time]=cscript.exe //T:30 //NoLogo check_time.vbs server1,server2,server3 20 240
to

Code: Select all

check_ntp_time=cscript.exe //T:30 //NoLogo check_time.vbs server1,server2,server3 20 240
Restart the NSClient service, it should work for you.

You may have to adjust the path for the check_time.vbs script, for example if you copied the script to the scripts folder, the command would be defined like this.

Code: Select all

check_ntp_time=cscript.exe //T:30 //NoLogo scripts\\check_time.vbs server1,server2,server3 20 240
Try that and let us know if it works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked