Checking time on remote host

Jason Martin jhmartin at toger.us
Mon Apr 17 22:43:43 CEST 2006


On Mon, Apr 17, 2006 at 03:45:45PM -0400, James Nachlin wrote:
> Writing the plugin would be easy if there were a way to transmit the 
> results of `date +%s` via check_nrpe.

Have Nagios invoke the following script, passing in the
appropriate arguments
#!/bin/sh
TIME=`perl -e 'print time()'`;

check_nrpe -H $1 -c the_command -a $TIME $2 $3
#EOF

On the remote end, compare the argument passed by check_nrpe to
the current time and alarm if the time differs by more than
$WARNTIME and $CRITTIME.

Alternatively, run the 'daytime' xinetd server on the nagios
host and have the script invoked on the client by check_nrpe
call back to the nagios host and get the time.

-Jason Martin

> 
> Jim
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when 
> reporting any issue. ::: Messages without supporting info will risk being 
> sent to /dev/null

-- 
When I tried to take an ego trip I got stopped at the border
This message is PGP/MIME signed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060417/b42ae18e/attachment.sig>


More information about the Users mailing list