recognizing string from HTTP checks?

David Rosenstrauch darose at darose.net
Fri Jul 17 23:05:09 CEST 2009


Ray Kiddy wrote:
> Why is this not recognizing that "www.domain2.com" is not returning  
> the string I want it to return? Even if the domain is being  
> redirected, it is being redirected wrong. At no point is that URL  
> returning the string I want it to see. So, "www.domain2.com" should be  
> red. But it is green.
> 
> Any suggestions on how to make this work?
> 
> thanx - ray

Couple of suggestions:

1) use -f follow in your check_http call to follow redirects.  (See 
check_http -help for details.)

2) I've found that HTTP servers using virtual hosting work a bit 
differently than other HTTP servers.  i.e.,

GET /foo.html HTTP/1.0

vs.

GET /foo.html HTTP/1.0
Host: myvirtualdomain.com


So I use 2 different check_http calls for this:

define command {
	command_name	check_http
	command_line	$USER1$/check_http -I $HOSTADDRESS$ -f follow $ARG1$ 
$ARG2$ $ARG3$
}

define command {
	command_name	check_http_virtual
	command_line	$USER1$/check_http -H $HOSTADDRESS$ -f follow $ARG1$ 
$ARG2$ $ARG3$
}


HTH,

DR

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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