[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Check a website and raise an alert if the site contains a search string
From: |
Marcus Mülbüsch |
Subject: |
Check a website and raise an alert if the site contains a search string |
Date: |
Wed, 27 Jul 2016 17:40:47 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hello list,
I check a website (XML-content) and if I find the string that says
type="alarm" I want to raise an alert.
However, if I see it right monit will send an alarm only if a
http-connection fails, either because the server is not responding, or
the content is not there.
So given the following config:
check host somehost with address 11.22.33.44
if failed
request "/some/uri/file.xml"
use http headers [Authorization: Basic something]
with content = 'type="alarm"'
then alert
I will get no alarm when the server responds with:
<alarms>
<fault type="alarm" some_more_data>
<text>Error</text>
<source>source</source>
</fault>
</alarms>
but I will get an alarm if the server simply responds with:
> <alarms/>
However, I want it to be the other way around.
How can I achieve that?
Marcus Mülbüsch
- Check a website and raise an alert if the site contains a search string,
Marcus Mülbüsch <=