check_http --url and --string don't work together?

Hari Sekhon hpsekhon at googlemail.com
Thu Aug 17 12:05:23 CEST 2006


Hari Sekhon wrote:
> I can't seem to use --url and --string together. Url seems to make it 
> not bother checking the string.
>
> First I test the --string works as follows:
>
> check_http -S -H www.somedomain.com --string='<html blah blah <title> 
> The Wrong Nonexistent Web Page</title>...'
>
> which returns as expected. This is what I want to make sure it will 
> warn me if it isn't finding exactly what I expect.
>
> CRITICAL - string not found|time=0.210894s;;;0.000000 size=6403B;;;0
>
>
> But if I do
>
> check_http -S -H www.somedomain.com --url="/some/path/" 
> --string='<html blah blah <title> The Wrong Nonexistent Web 
> Page</title>...'
>
> I get
>
> OK - HTTP/1.1 302 Found - 0.110 second response time 
> |time=0.110347s;;;0.000000 size=690B;;;0
>
>
> It doesn't check the string! Instead it just says that because some 
> page was directed to that everything must be ok... ie False Positive.
>
>
> The bigger picture:
>
> I am trying to do testing of an https login page and get into a 
> website. This requires that I log in via ssl and supply a username and 
> password. The problem is that the login page will redirect to 
> somewhere regardless of the result. If the login is successful you can 
> get the internal pages and if unsuccessful it redirects to another 
> login page. So I really need to get --url and --string working 
> together to check the actual html.
>
> I know there is webinject but I'd rather stick to check_http, it's 
> much more straight forward and webinject's dependencies failed to 
> install yesterday so I'd rather do this than bother fixing that just 
> to try it.
>
>
> Any ideas on getting this url and string business to work together?
>
>
> Hari
>

I thought this was because of the redirect so I went back to --help and 
found --onredirect so now when I do --onredirect=follow it works fine 
and complains about the string.

Sorted.


Hari

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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