check_http issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
phroggelator
Posts: 5
Joined: Wed May 07, 2014 10:37 pm

check_http issue

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_http issue

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked