check_http on a directory with string search


#1

Hi Everyone,

I’m trying to use check_http to check http content on a particular directory.

for example, I want to make sure ‘’ is found on the page loaded at: www.chaseguy.com/somedir/

Right now I am trying this like so:

check_http -H chaseguy.com -u /somedir/ -R ‘.]*’ -t 30

But this seem to return ‘OK’ as long as the directory exists and doesn’t actually check the page that loads there for the regular expression I specified.

Does anyone know if this is possible, or if I am doing something wrong? Any help would be greatly appreciated! Thanks.

James


#2

Hi,

as the expression you’re looking for ("") is pretty simple, I’d suggest:
forget about regular expressions, and use the basic search:
-s “</html”>

=> check_http -H chaseguy.com -u /somedir/ -s “” -t 30
should work better


#3

Hi, Thanks for your reply

I tried what you said but then your suggestion made me realize my method for testing was flawed. I assumed if I tried this check on a directory with no default page (index.html or what have you) that I should not be able to find on that page, but of course it returns a directory listing page which does have tags – so the check was working correctly, and my logic was not.

When I changed the search string to something like ‘blahblahblah’, the test correctly failed.

Thanks for your help!