-
Notifications
You must be signed in to change notification settings - Fork 29
Nagios Plugin check_clock
Davide Madrisan edited this page Oct 10, 2015
·
1 revision
check_clock - returns the number of seconds elapsed between local time and Nagios time
[/etc/nrpe.d/check_clock]
command[check_clock]=/usr/lib/nagios/plugins/check_clock --refclock $ARG1$ -w 60 -c 120
where $ARG1$
is the number of seconds since the "Epoch"
(1970-01-01 00:00:00 UTC) -- $(date '+%s')
provided by the Nagios poller.
This check is intended for alerting when the number of seconds elapsed between the Nagios poller and the monitored server exceeds a given threshold (60 seconds for the warning state, and 120 seconds for a critical notification, in the example above). The clock of the Nagios server needs, of course, to be synchronized to an NTP server.
This plugin returns the number of seconds elapsed between
the host local time and Nagios time.
Copyright (C) 2014 Davide Madrisan <[email protected]>
Usage:
check_clock [-w COUNTER] [-c COUNTER] --refclock TIME
Options:
-r, --refclock COUNTER the clock reference (in seconds since the Epoch)
-w, --warning COUNTER warning threshold
-c, --critical COUNTER critical threshold
-v, --verbose show details for command-line debugging
(Nagios may truncate output)
-h, --help display this help and exit
-V, --version output version information and exit
Examples:
check_clock -w 60 -c 120 --refclock $ARG1$
# where $ARG1$ is the number of seconds since the Epoch: "$(date '+%s')"
# provided by the Nagios poller
clock OK - time delta 39s | clock_delta=39
clock_delta