check_http status reports OK when a 404 error occurs

nagios at vsi.net nagios at vsi.net
Tue Jun 14 01:18:58 CEST 2005


Currently, we have nagios v 2.0b2 with nagios-plugins v 1.4 installed. The check_http command does not return a WARNING/CRITICAL status when a page 404's or has any other error(i.e 500,302, etc). I've ran other versions of nagios on other systems and remember a WARNING/CRITICAL status being returned when anything other than a 200 OK was returned. When ran from the command line HTTP WARNING is returned but when looking at the web interface the status is still OK and under status information I see the same output that i get when ran from the command line, HTTP WARNING. I'm not a programmer but from looking at the source of the check_http command it seems that i should get an HTTP WARNING and the status should change from OK to WARNING. This is not the case in my situation. Maybe I'm missing something here and have this misconfigured so I will post the relevant parts of my configuration her
 e. Can anyone see what i'm doing wrong? Has anyone had similar issues with the check_http 
 plugin and there resolutions?

>From the command line:

./check_http -H xxx.xxx.xxx -I 1.2.3.4 -u /folder/index.html 

HTTP OK HTTP/1.1 200 OK - 232 bytes in 0.009 seconds |time=0.009245s;;;0.000000 size=232B;;;0

./check_http -H xxx.xxx.xxx -I 1.2.3.4 -u /folder/index.htmll
 
HTTP WARNING: HTTP/1.1 404 Not Found


>From the checkcommands.cfg :

# 'check_http' command definition
define command{
	command_name	check_http
	command_line	$USER1$/check_http -H $HOSTADDRESS$
	}

# 'check_http_custom' command definition
define command{
	command_name	check_http_custom
	command_line	$USER1$/check_http -H $HOSTADDRESS$ -I 111.222.333.444 -u /folder/index.html
	}

>From the hosts.cfg :

define host{
	host_name		xxx.xxx.xxx
	alias			Client Website
	address			xxx.xxx.xxx
	parents			parent
	max_check_attempts	10
	notification_interval	120
	notification_period	24x7
	notification_options	d,u,r
	contact_groups		admins
	}
	
define host{
	host_name		yyy.yyy.yyy
	alias			Client2 Website
	address			yyy.yyy.yyy
	parents			parent
	max_check_attempts	10
	notification_interval	120
	notification_period	24x7
	notification_options	d,u,r
	contact_groups		admins
	}
	
>From the hostgroup.cfg :

define hostgroup{
	hostgroup_name	www_group
	alias		Websites
	members		xxx.xxx.xxx,yyy.yyy.yyy
	}


>From the service.cfg :


define service{
	use				generic-service		; Name of service template to use

	hostgroup_name			www_group
	service_description		HTTP_Custom
	is_volatile			0
	check_period			24x7
	max_check_attempts		3
	normal_check_interval		3
	retry_check_interval		1
	contact_groups			admins
	notification_interval		120
	notification_period		24x7
	notification_options		w,u,c,r
	check_command			check_http_custom
	}




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list