Linux – Nagios Monitoring Text on a Website

linuxmonitoringnagioswebsite

I was wondering if I could get some help with monitoring text on a website. I.E. If I wanted to monitor google.com for the text "Privacy", I thought I would use the following command:

check_http -H google.com -u http://www.google.com -s "Privacy"

But it is not working. I get "OK" no matter what I put in quotes. I am obviously using either the wrong command or wrong option. Please Help.

Best Answer

Try leaving put the -u. -u gives the path (page) to retrieve, default is "/", it doesn't take the entire URL. Here is my output when I leave it out.

$ ./check_http -H www.google.com -s "Privacy"
HTTP OK HTTP/1.0 200 OK - 0.041 second response time |time=0.040579s;;;0.000000 size=5257B;;;0
$ ./check_http -H www.google.com -s "Privacyblahdibla"
HTTP CRITICAL - string not found|time=0.048169s;;;0.000000 size=5257B;;;0

If you want to get a specific page, use the -u like this

$ ./check_http -H www.google.com -u "/ig" -s "Privacy"
HTTP OK HTTP/1.0 200 OK - 0.166 second response time |time=0.165896s;;;0.000000 size=87843B;;;0
Related Topic