Problem with check_http

Hi,
I too got almost same message as written above with some changes in the numerical in the complete details of a service.

thanks,
512

Well if it is the same then that means that the check works, but not being able to see the output for myself I can’t confirm it either way. Pls run the command again then directly afterwards do echo $? to print the exit status, like

[root@localhost libexec]# echo $? 0 [root@localhost libexec]#
This has to be done straight after the check_http command.

hi,
I did it and the output is the same as you told.I got 0 after executiing
echo $?
What should i do next?

Thanks,
512

“0” is the OK status, so everything is fine, which is good. Make your service check and check_http command object as follows (replacing and with your authentication details and <url/to/check.html> with the correct url as appropriate
[blockquote]define service{
…some stuff…
**service_description HTTP
check_command check_http!-a : -u ](http://)<url/to/check.html> **
…maybe some other stuff…
}

define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$

}
[/blockquote]

Hi,
I used the same define command as said above.
Coming to check_command i first gave google.com in place of
](http://)<url/to/check.html>
then the error is an error saying that
HTTP WARNING: HTTP/1.1 403 Forbidden
When i give the locaion of a html page as
ipaddress/root/hai.html
the error is
HTTP WARNING: HTTP/1.1 404 Not Found
although the location is correct

Please check this once.
Thanks,
512

[blockquote]Coming to check_command i first gave google.com in place of
](http://)<url/to/check.html>
then the error is an error saying that
HTTP WARNING: HTTP/1.1 403 Forbidden [/blockquote]

No, this won’t work. You need to supply a URL of a page that is actually present on the host server you are checking, as you attempted with the second attempt.

[blockquote]When i give the locaion of a html page as
ipaddress/root/hai.html[/blockquote]

So are you saying that if you put http://ipaddress/root/hai.html in your browser it returns a valid web page? (It’s just that the path doesn’t look correct with /root/ in it…)

yes. absolutely.

I meant to click edit butu i clicked quote instead… see below.

odd. It’s not normal to configure a www server to serve pages from the root home directory, generally they live in /var/www/html or some such place. What do you get if you try this from the command line?

[blockquote]./check_http -v -I -a : -u ipaddress/root/hai.html [/blockquote]

(omit -a : if not required). Pls paste the output if possible this time rather than just giving a general idea of what it says (assuming you are not working on the console, which makes life a little difficult and in which case just do your best…)

hi,

HTTP WARNING: HTTP/1.1 404 Not Found 

is the only output when i am giving
ipaddress/root/hai.html

But there is hai.html in my /root/

thanks,
512

well if the webserver isn’t configured to serve pages from /root/ then it won’t be accessible and I’m surprised you can get to it via a web browser on anything else but the local machine. For instance in the earlier check.html example, this lives physically on the server in /var/www/html/ but I access it via a web browser through nagios/html because that’s how the web server is set up…

hi,
I will check the web server once.

Thanks,
512