Discussion:
check_http 500 error
Javier D'Ovidio
2011-01-21 15:46:14 UTC
Permalink
Hello All:
This is my first post to this mailing list so be nice with me :P I'm
facing a few issues with the check_http plugin. I'm checking an apache
on a host using check_http. Looking at the Nagios CGI I can see the
service in a CRITICAL state with the following information:

Status Information:HTTP CRITICAL: HTTP/1.1 500 Internal Server Error -
720 bytes in 0.201 second response time
Performance Data:time=0.201368s;3.000000;5.000000;0.000000 size=720B;;;0


Now, when I run the check_http on the command line, I get a different answer:

./check_http -H myhost.mydomain.net
HTTP OK: HTTP/1.1 200 OK - 279 bytes in 0.002 second response time
|time=0.001871s;;;0.000000 size=279B;;;0

This is my command definition:

define command{
command_name check_site_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 5 -c 7 -t 8
}


As you can see, its very simple. Did anyone seen something like this
in the past? I have no idea why this might be happening

I'm running:
check_http v1.4.15 (nagios-plugins 1.4.15)
Nagios Core 3.2.3
CentOS release 5.5

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help-5NWGOfrQmneRv+***@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
Thomas Guyot-Sionnest
2011-01-25 02:32:01 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is my first post to this mailing list so be nice with me :P I'm
facing a few issues with the check_http plugin. I'm checking an apache
on a host using check_http. Looking at the Nagios CGI I can see the
Status Information:HTTP CRITICAL: HTTP/1.1 500 Internal Server Error -
720 bytes in 0.201 second response time
Performance Data:time=0.201368s;3.000000;5.000000;0.000000 size=720B;;;0
./check_http -H myhost.mydomain.net
HTTP OK: HTTP/1.1 200 OK - 279 bytes in 0.002 second response time
|time=0.001871s;;;0.000000 size=279B;;;0
define command{
command_name check_site_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 5 -c 7 -t 8
}
As you can see, its very simple. Did anyone seen something like this
in the past? I have no idea why this might be happening
$HOSTADDRESS$ is usually the IP-address of the server in Nagios. The
general ways of using check_http are:

1. -H <vhost> -I <ip_addr>

where vhost is the hostname generally used to access the server and -I
is the server's IP, This is one way one can test an individual server in
a pool of load-balancer servers.

2. -H <hostname>

Where hostname is the server to test - it will be resolver to an ip
address and check_http will connect to that IP.


If #1 is unclear you should read about http name-based virtual hosting.


You can also read more about check_http's usage with check_http --help.

Thanks

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0+NhoACgkQ6dZ+Kt5BchYURgCfZ6und1m3Lmfms7N4LQamovH4
cuAAoNXhsRKtuo1OpLrG1I/SVJbxxL58
=Amtq
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help-5NWGOfrQmneRv+***@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
Javier D'Ovidio
2011-01-28 10:49:05 UTC
Permalink
Thank you Thomas, I actually tried that already (I think I tried every
single option with check_http)

What I can't figure out is why would nagios report an http 500 and running
exactly the same command from a shell it works perfectly fine:


This is the HTTP Check Service CGI for myhost.mydomain.net:
Status Information:HTTP CRITICAL: HTTP/1.1 500 Internal Server Error -
720 bytes in 0.201 second response time
Performance Data:time=0.201368s;3.000000;5.000000;0.000000 size=720B;;;0


This is from a shell:
./check_http -H myhost.mydomain.net
HTTP OK: HTTP/1.1 200 OK - 279 bytes in 0.002 second response time
|time=0.001871s;;;0.000000 size=279B;;;0

I tried with Curl and that works (I get a 200). Does anyone know about any
kind of debug I can do? I'm not sure where to start as everything looks fine
from a command line.



Regards.
Javier.
Post by Thomas Guyot-Sionnest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is my first post to this mailing list so be nice with me :P I'm
facing a few issues with the check_http plugin. I'm checking an apache
on a host using check_http. Looking at the Nagios CGI I can see the
Status Information:HTTP CRITICAL: HTTP/1.1 500 Internal Server Error -
720 bytes in 0.201 second response time
Performance Data:time=0.201368s;3.000000;5.000000;0.000000 size=720B;;;0
./check_http -H myhost.mydomain.net
HTTP OK: HTTP/1.1 200 OK - 279 bytes in 0.002 second response time
|time=0.001871s;;;0.000000 size=279B;;;0
define command{
command_name check_site_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 5 -c 7 -t 8
}
As you can see, its very simple. Did anyone seen something like this
in the past? I have no idea why this might be happening
$HOSTADDRESS$ is usually the IP-address of the server in Nagios. The
1. -H <vhost> -I <ip_addr>
where vhost is the hostname generally used to access the server and -I
is the server's IP, This is one way one can test an individual server in
a pool of load-balancer servers.
2. -H <hostname>
Where hostname is the server to test - it will be resolver to an ip
address and check_http will connect to that IP.
If #1 is unclear you should read about http name-based virtual hosting.
You can also read more about check_http's usage with check_http --help.
Thanks
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0+NhoACgkQ6dZ+Kt5BchYURgCfZ6und1m3Lmfms7N4LQamovH4
cuAAoNXhsRKtuo1OpLrG1I/SVJbxxL58
=Amtq
-----END PGP SIGNATURE-----
Thomas Guyot-Sionnest
2011-01-28 11:06:08 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Javier D'Ovidio
Thank you Thomas, I actually tried that already (I think I tried every
single option with check_http)
So can you show me the check_site_http command definition where you pass
both -H and -I parameters?

Also, what did you put for "address" in your host definition?

Thanks

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1CoyAACgkQ6dZ+Kt5BchbGrACfSpwo2gJiw/6piT6UWbyoQ7zD
GToAni/EVq7A/HlZ928wVECjV2VDaygt
=R0FR
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help-5NWGOfrQmneRv+***@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
Javier D'Ovidio
2011-01-28 12:26:09 UTC
Permalink
Thomas:

First of all, you rock :) you make me realize what my mistake was. I tend to
use IP addresses in the address property on the host definition.
When getting the data for you, I figure that on the command definition I had
$HOSTADDRESS$ on both the -H and the -l as below.

define command{
command_name check_http_port
command_line $USER1$/check_http -H $HOSTADDRESS$ -l
$HOSTADDRESS$ -t 4 -w $ARG1$ -c $ARG2$ -p $ARG3$ -N
}

I changed the command definition to look like:

define command{
command_name check_http_port
command_line $USER1$/check_http -H $HOSTNAME$ -l $HOSTADDRESS$ -t
4 -w $ARG1$ -c $ARG2$ -p $ARG3$ -N
}


Now all looks good on my testing environment.

Thanks you.


Javier.
Post by Thomas Guyot-Sionnest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Javier D'Ovidio
Thank you Thomas, I actually tried that already (I think I tried every
single option with check_http)
So can you show me the check_site_http command definition where you pass
both -H and -I parameters?
Also, what did you put for "address" in your host definition?
Thanks
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk1CoyAACgkQ6dZ+Kt5BchbGrACfSpwo2gJiw/6piT6UWbyoQ7zD
GToAni/EVq7A/HlZ928wVECjV2VDaygt
=R0FR
-----END PGP SIGNATURE-----
Loading...