Page 1 of 1

check_http issue

Posted: Wed Jan 14, 2015 9:51 pm
by phroggelator
Background: We have several web servers behind a load balancer. I am trying to check each individual server to ensure the various apache vhosts they have are working correctly.

The problem is that when I run:

check_http -H <apache_vhost> -v

I get the correct page back (as expected) - however this is via the load balancer. When I run:

check_http -I <server_ip> -k "Host: <apache_vhost>" -v

I get an error page (though with a 200 response code) rather than the expected page. Using strace against both commands reveals the following GET commands are actually issued:

"GET / HTTP/1.1\r\nUser-Agent: check_http/v2.0 (nagios-plugins 2.0)\r\nConnection: close\r\nHost: http://<apache_vhost>\r\n\r\n" - from the -H <vhost>
"GET / HTTP/1.0\r\nUser-Agent: check_http/v2.0 (nagios-plugins 2.0)\r\nConnection: close\r\nHost: http://<apache_vhost>\r\n\r\n" - from the -I <ip>

While I cant state for certain yet the change in protocol version is why I get different pages back, I cant see this being correct or intended behaviour. The check_http version is 2.0, but I haven't seen anything in the change notes to suggest this has been corrected. I'll double check with the newest version today.

EDIT: version 2.0.3 exhibits the same issue when using -I

Re: check_http issue

Posted: Thu Jan 15, 2015 11:51 am
by sreinhardt
I thought we resolved this in 2.0.2 or 2.03, I guess I will take a look and see why this would be the case. Aside from forcing the ip to check, they should be essentially identical.