[Top][All Lists]

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

Re: [monit] regex in http tests

From: Edmunds
Subject: Re: [monit] regex in http tests
Date: Mon, 17 May 2010 11:58:48 +0300

if failed url http://local/test.php
     and content != '^OK$'
     then alert

never triggers an alert. I tried with content "OK", "ERR is not OK"
and just "ERR" - monit always displays "online with all services".
Anyway I believe it works the other way around:

and countent == "something"

if this test fails an alert is triggered

Regarding "Monit uses POSIX Extended Regular Expressions" - yes, that
is what I understand, but it doesn't actually seem to work. An example
would be (quote from wikipedia):

[^ ] Matches a single character that is not contained within the
brackets. For example, [^abc] matches any character other than "a",
"b", or "c". [^a-z] matches any single character that is not a
lowercase letter from "a" to "z". As above, literal characters and
ranges can be mixed.

So I tried [^OK] - this should match any single character that is not
O or K, but an alert is never triggered, regardless if the content
tested is "OK" or "ERR"

reply via email to

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