PDA

View Full Version : check_http requires home page when -u switch is used


jmeek
14th March 2006, 23:58
This was compelling enough I felt it should be a new subject, the original issue was found here:


check_http working in shell but not in oreon
http://forum.oreon-project.org/viewtopic.php?t=1365

More review shows that when checking a specific web page with check_http a home page is required before the page on the url switch is reviewed. If the home page exists then the check works, if not a 403 error. The check in question works on the command line, however, responding with the "200 OK" as expected. the check in question is

check_http -H $HOSTADDRESS$ -u /monitoring.aspx -R HOSTUP

Again, in shell I get the 200 response. In oreon a 403. The same check on systems that have a default home page work correctly in the shell or oreon.

The site(s) in question are completely database driven based on the host header name so I cannot have a default page so I am compelled to solve this one of a few ways:

1) Don't check the URL (not an option really but it needs to be said)

2) Have the programmers write some code that if the referrrer IP is the oreon system and the header is "check_http 2.4 (nagios)" (whatever is says, I'm not on the box at the moment) then fake a home page someplace.

3) Have someone help me understand how to get the check_http to not require a home page before the "-u" switch is followed.

Thoughts ? BTW, I'm hoping for answer 3 ....

DonKiShoot
15th March 2006, 10:46
Do you check your httpd/error_log and log for finding what exactly check_http try to get (when it s ok and when it s not ok for finding the difference) ?

Do you verify that oreon generate correctly the command line in the nagios generated files ?

Sorry for my poor english :oops:

jmeek
15th March 2006, 18:43
I already checked the logs, that's why I know about the need for the default home page

ccsonline
25th March 2006, 04:35
Did you try:

check_http -H $HOSTADDRESS$ -u http://$HOSTADDRESS$/monitoring.aspx -R HOSTUP

I use it like that but without variables:

-u http://www.XXXXXXX.com/index.html

jmeek
6th July 2006, 17:42
the answer was to fully qualify the -U path before the -R

Thanks to everyone to posted