String matching isn't working


#1

Hi,

I need to actually check the availability of the url, “www.gardasil.com/pdc/user_info/site_monitor.jsp” and also check for the string, ‘LIVE’.

When i checked using, “…/libexec/check_http -H gardasil.com -u /pdc/user_info/site_monitor.jsp -s “LIVE” -f follow -t 120”, i got the following output:

HTTP WARNING - maximum redirection depth 15 exceeded - gardasil.com:80pdc/user_info … onitor.jsp

Please help to fix this issue.


#2

Try to put the url in double quotes when defining the check_command:
-u “/pdc/user_info/site_monitor.jsp”


#3

Now I get an ok status…
**
[nagios@iserv163 etc]$ …/libexec/check_http -H www.gardasil.com -u /pdc/user_info/site_monitor.jsp -s LIVE -t 10
HTTP OK - HTTP/1.1 301 Moved Permanently - 0.004 second response time |time=0.004448s;;;0.000000 size=576B;;;0**

However for the other website, hpv.com i still see an error. I have checked in the browser that the site is up with the word “LIVE” in the body. But checking from nagios returns an error… :frowning:

[nagios@iserv163 etc]$ …/libexec/check_http -H www.hpv.com -u /pdc/user_info/site_monitor.jsp -s LIVE -t 10
HTTP WARNING: HTTP/1.1 404 Not Found
[nagios@iserv163 etc]$ …/libexec/check_http -H www.hpv.com -u “/pdc/user_info/site_monitor.jsp” -s LIVE -t 10
HTTP WARNING: HTTP/1.1 404 Not Found

Any thoughts?


#4

Hm, from my location the specified url works OK.

./check_http -H www.hpv.com -u /pdc/user_info/site_monitor.jsp -s LIVE -t 10 HTTP OK HTTP/1.1 200 OK - 0.304 second response time |time=0.304071s;;;0.000000 size=644B;;;0

with or without double quotes.
Are you sure you can reach the website from your Nagios machine, maybe some access list or firewall issues…
…or the check_http plugin? Which version of nagios-plugins are you using?


#5

How can I check the version of the nagios plugin?


#6

I forgot to mention in my earlier post that I am checking for hpv.com url from nagios dmz.