monit-general
[Top][All Lists]
Advanced

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

Re: Feature request for config file checking?


From: Rick Robino
Subject: Re: Feature request for config file checking?
Date: Wed, 11 Jun 2003 02:16:52 -0700


On Tuesday, June 10, 2003, at 11:11  PM, Mark Ferlatte wrote:

I want to be able to run any script.  Simply a:

check timestamp foo.conf if changed then run "/etc/init.d/foo restart"

solves all of these problems easily.

"timestamp" remains flexible so that we can AND an alert, execute
restart script or whatever besides/rather-than just sending a signal?

Just run a script that sends kill -SIG. No need for monit to have to add more
special case parsing.

That is what I meant to imply when I said:

On a related note, w.r.t to the discussion about keyword alternatives: maybe a line like the above suggests a `cmd` or $(cmd) shell-style command substitution expression as a way to handle arbitrary solutions where a keyword doesn't yet exist?

So - I also agree with this idea: + for the ability to run arbitrary commands (whatever the syntax). The command could be fed the subject of the expression - pid, timestamp, timeout, etc, as first and only argument. At least the pid.

If some primitive conditional expression becomes part of monit's vocabulary as proposed in J-H's RFD it may also be worth discussing the notion of checking the return code of the proposed arbitrary command, so as to branch to other statements if the first command did not exit 0. For one, it may alleviate the temptation to make a single command allowed cover all cases by itself outside of monit, possibly to the point of duplicating some of monit's own functionality. For two, it would satisfy generically many more complicated needs than executing one command that may only fail timeout*times and eventually leave the service down.

Of course this may constitute serious featurecreep, and checking the return value requires monit to wait for the command to terminate (potential for problems), but it is a natural complement to the ability to run scripts other than start/stop and in light of other proposed syntax changes.

Being able to run a command besides start or stop on a per-check basis like timestamp is a big win already, maybe there is no reason for further conditional processing - and it could be that I have even misunderstood the "if" proposal on the table in thinking that checks can have individual responses. Maybe if timeouts could be expressed in a way where monit would execute the arbitrary command if timeout n is reached the same problem would be solved without as much fuzz.

I don't know, but if the movement is towards more complex functionality then this sort of granular control is something I would like to see. Just a thought. Apologies for extending the scope of this subject to that of the general control file language.

--
Richard T. Robino





reply via email to

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