# 'check_http' command definition<br>define command{<br>        command_name    check_http<br>        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$<br>        }<br><br>Do I need to add "$ARG2$" ? <br>
<br><div class="gmail_quote">On Wed, Nov 25, 2009 at 3:49 PM, Thomas Guyot-Sionnest <span dir="ltr"><<a href="mailto:dermoth@aei.ca">dermoth@aei.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><div></div><div class="h5"><br>
On 25/11/09 01:14 PM, Eric wrote:<br>
> Hello. I would like to use check_http to check a webpage for a certain<br>
> word to see if it's working correctly. If I run check_http from the<br>
> command line, it works fine:<br>
><br>
> [root@nagios ~]# check_http -H uranus -u<br>
> "<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a><br>

> <<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>>"<br>

> -f follow --string=Query<br>
> HTTP OK: HTTP/1.1 200 OK - 2059 bytes in 0.149 second response time<br>
> |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<br>
> word that isn't on that page I get an error:<br>
><br>
> [root@nagios ~]# check_http -H uranus -u<br>
> "<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a><br>

> <<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>>"<br>

> -f follow --string=blah<br>
> HTTP CRITICAL: HTTP/1.1 200 OK - string not found - 2059 bytes in 0.148<br>
> 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<br>
> "<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a><br>

> <<a href="http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes" target="_blank">http://uranus/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/main.xts&startwel=yes</a>>"<br>

> -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:<br>
> SCHEDULE_FORCED_HOST_SVC_CHECKS;uranus;1259172769<br>
> [1259172774] SERVICE ALERT: uranus;Check page content for the word<br>
> password;CRITICAL;SOFT;1;HTTP CRITICAL: HTTP/1.1 404 Not Found - string<br>
> 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<br>
> way in the config file as it does from the command line? What can I do<br>
> to fix this? Thank you..<br>
<br>
</div></div>What is your check_http command definition?<br>
<br>
- --<br>
Thomas<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.6 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
iD8DBQFLDcKQ6dZ+Kt5BchYRAqAPAKDeB9LdcTIyktOyG90hOqADuD5q2ACbBQPg<br>
1DClk4lx1SqNfrWAf+ePc44=<br>
=mQQ+<br>
-----END PGP SIGNATURE-----<br>
<br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what's new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>
_______________________________________________<br>
Nagiosplug-help mailing list<br>
<a href="mailto:Nagiosplug-help@lists.sourceforge.net">Nagiosplug-help@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-help" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagiosplug-help</a><br>
::: Please include plugins version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br>