Hi,
I have installed and configured naigos in one system(centos). I am monitoring another centos system and a freeBSD system using this nagios. When i checked it by using check_http command which is there by default in commands.cfg. I used it for all 3 (2 systems mentioned above and another is the system in which naigos is installed. I am getting error while checking this.
The errors are like this
HTTP WARNING: HTTP/1.1 403 Forbidden { this is for the system in which nagios is installed and running.}
connection refused { this is the error in case of remaining 2 systems which this nagios is monitoring(centos and freeBSD)}
the $ARG1$ implies that you need additional arguments in your service check object’s check_command variable, after check_http.
Looking briefly at the usage for check_http we can see the available arguments…
[blockquote][root@localhost libexec]# ./check_http
check_http: Could not parse arguments
Usage: check_http -H | -I -u ] -p ]
-w ] -c ] -t ] -L]
-a auth] -f <ok | warn | critcal | follow>] -e ]
-s string] -l] -r | -R ] -P string]
-m <min_pg_size>:<max_pg_size>] -4|-6] -N] -M ] -A string]
-k string] -S] -C ] -T ]
[root@localhost libexec]# [/blockquote]
In it’s simplest form you need to supply the -u argument, the URL you are checking… so you need to change your service object to something like
[blockquote]command_line check_http!-u localhost/nagios/check.html [/blockquote]
Anything after the “!” becomes $ARG1$ in the command object. If you subsecquently start getting “401 Auth Req’d” then you may even need to add a username and password to the command_line, like
[blockquote]command_line check_http!-a : -u localhost/nagios/check.html [/blockquote]
hi,
I checked it. when i give just the URL the status information is as you said that auth is required. But, When i gave my username and password the status information is just null
and status is warning.
Please check this once.
Thanks,
512
very odd, I’ve tried all sorts of wierd and wonderful mis-configurations and can’t get a NULL response for any of them. What is the url you are checking? I assume that when you access it from a browser that it loads up OK as without the auth you are at least getting the 401…
On our own nagios server here we are only checking a test page rather than one of the live nagios pages, I don’t know whether it might be worth you creating something similar and seeing if the check works for that… could rule out issues with the page you are trying to check, other than that, it is a mystery
you should not put the “<>” around the IP address (and also around username and pass);
Strides put them in the command line to say that you have to replace “” by your “IP address”
hi,
If i give by removing the symbols u mentioned here then, the result is warning, with which the status information is GET 172.22.2.231/nagios/check.html HTTP/1.0
No because you want to check the http service on the box directly really, else you are only checking that the proxy can/has seen the page and might be returning a cached version. Is “GET localhost/nagios/check.html HTTP/1.0” really all it comes back with? Only it doesn’t really seem to be an error message… If not, please post the whole of the output from the commandline test.
[blockquote][root@localhost libexec]# ./check_http -v -I 127.0.0.1 -a nagiosadmin:Password -u localhost/nagios/check.html
GET localhost/nagios/check.html HTTP/1.0
User-Agent: check_http/v1861 (nagios-plugins 1.4.11)
Connection: close
Authorization: Basic cmanafE9zYWRtaW93em1eTRtNHf0
127.0.0.1:80http://localhost/nagios/check.html is 306 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Date: Tue, 05 Aug 2008 07:49:18 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Mon, 31 Mar 2008 14:55:30 GMT
ETag: “23837e-2c-d7cc1c80”
Accept-Ranges: bytes
Content-Length: 44
Connection: close
Content-Type: text/html; charset=UTF-8
**** CONTENT ****
Test
HTTP OK HTTP/1.1 200 OK - 306 bytes in 0.005 seconds |time=0.005038s;;;0.000000 size=306B;;;0
[root@localhost libexec]# [/blockquote]