Hello. I would like to use check_http to check a webpage for a certain
word to see if it's working correctly. If I run check_http from the
command line, it works fine:<br><br>[root@nagios ~]# check_http -H uranus -u "<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>" -f follow --string=Query<br>
HTTP OK: HTTP/1.1 200 OK - 2059 bytes in 0.149 second response time |time=0.148962s;;;0.000000 size=2059B;;;0<br><br>I know that it's checking the page correctly because if I query for a word that isn't on that page I get an error:<br>
<br>[root@nagios ~]# check_http -H uranus -u "<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>" -f follow --string=blah<br>
HTTP CRITICAL: HTTP/1.1 200 OK - string not found - 2059 bytes in 0.148 second response time |time=0.148124s;;;0.000000 size=2059B;;;0<br><br>I have my configuration file for this website configured like this:<br><br>define service{<br>
use generic-service ; Inherit default values from a template<br> host_name uranus<br> service_description Check page content for the word password<br>
check_command check_http! -H uranus -u
"<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>"
-f follow --string=Query<br> }<br><br>I force a check in Nagios and see this in the Nagios logs:<br><br>[1259172769] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_SVC_CHECKS;uranus;1259172769<br>[1259172774] SERVICE ALERT: uranus;Check page content for the word password;CRITICAL;SOFT;1;HTTP CRITICAL: HTTP/1.1 404 Not Found - string not found - 478 bytes in 0.003 second response time<br>
<br>I see that it's getting a 404 error. Is it not handling the URL the same way in the config file as it does from the command line? What can I do to fix this? Thank you.. <br>