[Top][All Lists]

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

Re: [monit] bugs&deficiencies

From: Jan-Henrik Haukeland
Subject: Re: [monit] bugs&deficiencies
Date: Thu, 29 May 2008 20:45:43 +0200

On 29. mai. 2008, at 10.12, deis wrote:

I've been playing with monit for a few hours and it seems that I came across a bug in it (tested recent beta and stable versions). If I enter for an action exec "/bin/echo 1 >/some/destination", monit would actually run /bin/echo "1 >/some/destination" causing echo to throw out "1 >/some/destination" to console instead of sending 1 to the destination.

Monit's exec does not start a shell, but is a standard exec. That is, exec takes the first argument as the command to execute and the rest as arguments: exec [command [arguments]]. In other words using shell redirects and pipe will not work. To do this you must start a shell in the exec command like so:

exec "/bin/bash -c '/bin/echo 1 >/some/destination'"

Another very annoying deficiency of the tool is complete lack of chaining arbitrary conditions, smth like
if ...
   if ...
   then ...

and lack of logical operators (AND, OR, etc) in the if statements, which does not allow to make decisions based on complex conditions. E.g., I want to test connectivity to two hosts and execute an action only if both of them are down

Dependencies chains should handle some decision branching, though it is not as flexible. I agree that having nested if- statements and combining statements with logical operators would be very useful. I have been playing with the idea of building a real AST (abstract syntax tree) from parsing monit's small domain language and use this tree during validation which means that proper branching and combined statements can be used at validation time. But as usual time and resources are a constraint.

reply via email to

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