Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need a plugin that allows me to nagios looking for a well-defined text in the content of my web page. if the text is found I would ok sion error who can help me please

share|improve this question

2 Answers 2

The standard plugin check_http can do this:

check_http -H [hostname] -I [ip address] -u [url] -R [text to match]

The check will fail for the usual reasons, but also if the text (or regular expression) is not found in the returned page.

If you want to fail if the text is found, add the option --invert-regex.

share|improve this answer
    
thanks you very much –  user165158 Mar 18 '13 at 10:58
    
I have HTTP CRITICAL: HTTP/1.1 400 Bad Request - pattern not found - 1270 bytes in 0,069 second response time |time=0,068840s;;;0,000000 size=1270B;;;0 –  user165158 Mar 18 '13 at 13:11
    
Strange that you got a 400. What was the full command line you used? –  Flup Mar 18 '13 at 13:36
    
check_http -H chourouk1 -I @IP -u www.alchourouk.com -R "Site web réalisé par" –  user165158 Mar 18 '13 at 13:42
    
The argument for -u should be the path part of the URL. Try -u /. You might also have to do -H www.alchourouk.com if your host has more than one virtual host. –  Flup Mar 18 '13 at 13:58

Flup's answer seems great for a simple page.

If you want to do something similar but need to navigate through a set of login pages, we make use of http://webinject.org/ which allows a test to fill in forms etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.