Page 1 of 1

NTP time check

Posted: Tue Jun 05, 2012 5:58 am
by twigg0
Hi all,
I want to configure this plugin --> http://exchange.nagios.org/directory/Pl ... 29/details in Nagios XI.
On the server I want to check I've installed Nsclient. Is it a passive checks?
How can I configure it in Nagios XI?
Do I need to modify NSC.ini and then?

Thanks in advance

twigg0

Re: NTP time check

Posted: Tue Jun 05, 2012 11:14 am
by lmiltchev
This is a third party plugin and I am not familiar with it, however with any plugin, you can follow our general guidelines on managing plugins in Nagios XI:

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

Hope this helps.

Re: NTP time check

Posted: Tue Jun 05, 2012 1:31 pm
by twigg0
Thanks 4 reply...
I know that procedure for plugins, but this one is a passive checks I think...because the plugin is installed on the machine I have to monitoring...
However is there a procedure 4 this particular plugins?

Thanks

Re: NTP time check

Posted: Tue Jun 05, 2012 3:20 pm
by scottwilkerson
This was community contributed so I'm not totally familiar however it looks like there is some instructions on the page
http://exchange.nagios.org/directory/Pl ... 29/details

You would need to be sure NRPE is enabled on NSClient++

the line something like this would be added to the nsc.ini

Code: Select all

command[check_ntp_time]=cscript.exe //T:30 //NoLogo check_time.vbs server1,server2,server3 20 240
and would call it from nagios server with something like

Code: Select all

./check_nrpe -H <HOSTADDRESS> -c check_ntp_time

Re: NTP time check

Posted: Thu Jun 07, 2012 7:47 am
by mikew
Once you download the vbs script to the nsclient and the scripts directory, modify your nsc.ini. Note carefully the path to the vbs script and also note in this example two real time servers are added.

The NRPE section needs to allow the port, the arguments and the meta characters.

[NRPE]
port=5666
allow_arguments=1
allow_nasty_meta_chars=1

In the External Scripts section you will need to add this line all on one line. Notice the path to the scripts directory and the two time servers which are listed. These two time servers came from the ntp.org site so you can use the ones you choose.

[External Scripts]
check_ntp_time=cscript.exe //T:30 //NoLogo scripts/check_time.vbs 1.us.pool.ntp.org,2.us.pool.ntp.org 20 240

Test your setup by going to the Nagios server and the plugins directory to execute the script.

./check_nrpe -H 192.168.5.224 -c check_ntp_time
NTP OK: Offset +62.6480990 secs|'offset'=+62.6480990s;20;240;

Here you can see the time offset and that the script is working fine.

Now you will want to create the command for the plugin on XI by going to Configure/Core Config Manager/Commands/Commands and selecting New.

Creating this command is simple as you are using a check_nrpe plugin and the command is check_ntp_time that you defined in the nsc.ini
Once you create it save and apply.

Now create your service check and reference the command you created.