Table of Contents
check_remote_by_http_time
- nagios plugin for getting remote clock
diff by http
check_remote_by_http_time
[ -D ] -w warnlevel -c critlevel
-H ip-address -p port [ -u unit ]
check_remote_by_http_time is
a nagios plugin for remote checking hosts by (simplified) http.
It was written
as a (fast) alternative to net-snmp and it is designed to work with knoerre,
a small http-server.
check_remote_by_http_time
sends a "timediff" request with the current unix
timestamp to the remote server. Then it expects the difference in seconds
between local and remote system clock. It takes the value from the last
line of the remote HTTP response. The value will be interpreted as a positive
integer with up to 63 bits.
If the value is greater than the specified warning or critical level then
check_remote_by_http_time will also recognize the line before and print
it contents as additional information (if knoerre runs on the remote host
it will send its own timestamp in the line before last). This additional
or debug information is printed between the remote value and the performance
data. Its output is formatted as HTML-data with the original URL sent to
the remote host as link. See examples.
- -w warnlevel
- Specify the
warning level. The remote value must be greater than the warnlevel to trigger.
- -c critlevel
- Specify the critical level. The remote value must be greater
than the critlevel to trigger.
- -H ip-address
- Specify the IP address of the
remote server to check.
- -p port
- Specify the port of the http
server on the
remote host.
- -u unit
- Specify an optional unit string which is placed after
the remote value and which is visible in nagios.
- -D
- Use TCP_DEFER_ACCEPT
(see tcp(7)
). This can speed up our http-communication
by approx. 10 percent,
but it breaks tcp-communication by RFC - like many others too. It can also
cause trouble with loadbalancers like F5 which send "early" ACK packets
to the server before ACK from client.
check_remote_by_http_time
does
not use any files, but a sample nagios config is shown here:
# cat /etc/nagios/oth.cfg
define command{
command_name check_remote_time
command_line $USER1$/check_remote_by_http_time
-w $ARG1$ -c $ARG2$ -H
$HOSTADDRESS$ -p 8888 -u " sec(s) difference"
}
# cat /etc/nagios/msc.cfg
define service{
use service-1h
name time
check_command check_remote_time!30!1800
register 0
}
check_remote_by_http(1)
, knoerre(1)
http://downloads.tuxad.de/ngtx
Two examples of check_remote_by_http_time
with knoerre as remote http server:
$ check_remote_by_http_time
-H 172.16.1.1
-w 30 -c 300 -p 8888
REMOTE OK - 0 | timediff=0
$ check_remote_by_http_time
-H 172.16.1.5 -w 30 -c 300 -p 8888
REMOTE WARNING - 44 (<a href="http://172.16.1.5:8888/timediff/1222339166">1222339210</a>)
| timediff=44
Frank Bergmann, http://www.tuxad.com
Table of Contents