[Top][All Lists]

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

Re: Negation

From: Martin Pala
Subject: Re: Negation
Date: Tue, 28 Dec 2004 20:25:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

Full syntax of testing rule is:

 IF FAILED <test> THEN <action> [ELSE IF RECOVERED THEN <action>]

The second part is optional and if omited, monit will just send alert in the case of state change (i.e. "failed -> success"). It could be possible to use that for what you asked for, for example:

 if failed host port 80 protocol http then alert
 else if recovered then exec "/my/script"


Kaspar Landsberg wrote:
Hello again,

is there any way to use "negated" service checks? I'd like monit to perform some action if a given service is *succeeding* instead of failing.

Something like:

if succeeded port 80 ...
if not failed port 80 ...

That way one could ensure that a possible backup service on a remote
machine is not running concurrently with the primary service on the local machine.

Like "if service X is running on the local *and* remote machine at the same time, do <something>" (e.g. stop the remote service).

At least a simple negation like "if succeeded" or "if not failed" should be rather easy to implement I suppose.


To unsubscribe:

reply via email to

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