[Nagiosplug-help] help with check_http + string check
Eric
campee at gmail.com
Thu Nov 26 01:34:17 CET 2009
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
Do I need to add "$ARG2$" ?
On Wed, Nov 25, 2009 at 3:49 PM, Thomas Guyot-Sionnest <dermoth at aei.ca>wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 25/11/09 01:14 PM, Eric wrote:
> > 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:
> >
> > [root at nagios ~]# check_http -H uranus -u
> > "
> 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
> >"
> > -f follow --string=Query
> > HTTP OK: HTTP/1.1 200 OK - 2059 bytes in 0.149 second response time
> > |time=0.148962s;;;0.000000 size=2059B;;;0
> >
> > 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:
> >
> > [root at nagios ~]# check_http -H uranus -u
> > "
> 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
> >"
> > -f follow --string=blah
> > 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
> >
> > I have my configuration file for this website configured like this:
> >
> > define service{
> > use generic-service ; Inherit default values from a template
> > host_name uranus
> > service_description Check page content for the word password
> > check_command check_http! -H uranus -u
> > "
> 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
> >"
> > -f follow --string=Query
> > }
> >
> > I force a check in Nagios and see this in the Nagios logs:
> >
> > [1259172769] EXTERNAL COMMAND:
> > SCHEDULE_FORCED_HOST_SVC_CHECKS;uranus;1259172769
> > [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
> >
> > 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..
>
> What is your check_http command definition?
>
> - --
> Thomas
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFLDcKQ6dZ+Kt5BchYRAqAPAKDeB9LdcTIyktOyG90hOqADuD5q2ACbBQPg
> 1DClk4lx1SqNfrWAf+ePc44=
> =mQQ+
> -----END PGP SIGNATURE-----
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20091125/a01123f2/attachment.html>
More information about the Help
mailing list