Page 1 of 1

[Website] Forbidden words

Posted: Mon Feb 21, 2011 5:28 am
by PepijnBosgoed
Hi guys,

Since a few weeks I've been testing NagiosXI and it works great. However, we want to monitor websites because we are a webdesign company including our own hosting service. I know I can monitor websites on words that should be on the websites. But I want to monitor on words that should not be on the website, the so called forbidden words like: porn, sex or hacked. How can I monitor that with NagiosXI? Can I do that with the standard check_http or check_http_content or is there a plugin that I've missed in my search quest?

Thanks in advance!

Pepijn

Re: [Website] Forbidden words

Posted: Mon Feb 21, 2011 3:57 pm
by mguthrie
Most of the check plugins check for expected content, however, you might want to check the nagios exchange (exchange.nagios.org) and see if someone has already written a plugin like this. If not, you would probably modify a copy of one of the existing plugins so that the state return warning and critical instead of OK when certain strings are found.

Re: [Website] Forbidden words

Posted: Thu Feb 24, 2011 3:30 am
by PepijnBosgoed
@ mguthrie: I've already checked exchange, nagiosplugins.org and nagios.org/download/plugins. But unfortunately I can“t found a plugin which can monitor on the forbidden words. I will try to adjust a normal check, but if anyone can help me by providing such a plugin, I would really appreciate it :D

Pepijn

Re: [Website] Forbidden words

Posted: Thu Feb 24, 2011 11:38 am
by mguthrie
Here's the pseudo code if you know anyone who's decent at scripting in a particular language.

$arg = <your url>

$contents = fetch text contents of ($url)

process $contents line by line

if there is a regular expression match from the following list (spam and swear words)

print "bad words found!"
exit(2)

else
print "all good"
exit(0)