monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check a website and raise an alert if the site contains a search str


From: Marcus Mülbüsch
Subject: Re: Check a website and raise an alert if the site contains a search string
Date: Thu, 28 Jul 2016 12:37:15 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Am 27.07.2016 um 20:32 schrieb Jan-Henrik Haukeland:
On 27 Jul 2016, at 17:40, Marcus Mülbüsch <address@hidden> wrote:

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

There is double negation here which might be confusing, but hopefully clearer 
if you have to read the statement as

if failed -> request "/some/uri/file.xml"
if failed -> content = ‘type=“alarm”’

The last part means, if the response failed to produce content with 
‘type=“alarm”’ then fail. Which is the opposite of what you want. To fix this 
negate the test,

with content != 'type="alarm"'

Duh.

   Thank you. It's as simple as that and works.

But I have a special case where it doesn't work in that way, but for other reasons. I'm starting another thread.

Marcus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]