Hi everyone!

Im trying to set up monit, so that it tests for contents of a webpage
using regex (this is supported according to docs)

The webpage in question is a php page that does some checks and
outputs "OK" if all checks pass.

Now I want monit to alert me, if that page contains anything else
except "OK". So "Critical things are OK, but some minor error here"
should trigger an alert. At first I set up monitrc simply as this:

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

but that doesn't work, because "OK" can appear anywhere on the page.
So next I turned to regex:

if failed url http://local/test.php
       and content == '[OK]{2}'
       then alert

doesn't trigger alert if there are more strings

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

doesn't trigger an alert even if the page only contains "OK", while it should

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

trigger alerts even if the page only contains "OK"

I'm really out of ideas here ... seems that monit uses some really
strange regex in HTTP requests

--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to