Nagios Services question - HTTP check

Asgorath

[H]ard|Gawd
Joined
Jul 12, 2004
Messages
1,253
I am trying to get the following nagios command to work. I'm running this in the command line for testing purposes before I wrap it into a service check. Note: I took this example out of 'Building a Monitoring Infrastructure with NAGIOS' by David Josephsen

[root@VM-NETTOOLS nagios]# /usr/lib/nagios/plugins/check_tcp -H google.com -p 80
TCP OK - 0.061 second response time on port 80|time=0.060624s;;;0.000000;10.000000
[root@VM-NETTOOLS nagios]# /usr/lib/nagios/plugins/check_tcp -H google.com -p 80 -s 'GET / HTTP/1.0' -e 'HTTP/1.0 200 OK'
CRITICAL - Socket timeout after 10 seconds
[root@VM-NETTOOLS nagios]#
 
Last edited:
I am trying to get the following nagios command to work. I'm running this in the command line for testing purposes before I wrap it into a service check. Note: I took this example out of 'Building a Monitoring Infrastructure with NAGIOS' by David Josephsen

Is this going to work if google doesn't have the nagios plugin on their servers?
 
If you notice, the quote has two lines in it.

Part 1:

Check to see if google.com is listening on port 80. This works

Part 2:

Check to see if google.com is listening on port 80. Then send the string 'GET / HTTP/1.0'. Google should reply back with 'HTTP/1.0 200 OK'

Part 1 succeeds. Part 2 fails with 'Socket Timeout after 10 seconds'. So maybe I'm not giving google.com the right string to react to.

Long story short, I'm querying the web server at google.com...nothing nagios specific going on here.
 
Perfect. Here's what I put in my commands.cfg file...

define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -e '200 OK'
}


# 'check_http' command definition
define command{
command_name check_https
command_line $USER1$/check_http -H $HOSTADDRESS$ -S -e '200 OK'
}
 
Back
Top