monit-dev
[Top][All Lists]
Advanced

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

syntax change proposal


From: Martin Pala
Subject: syntax change proposal
Date: Tue, 30 Mar 2004 23:23:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312 Debian/1.6-3

Hi,

i though about solution of event refactoring side effect - it is described in CHANGES.txt (in cvs):

--8<--
Monit doesn't reset checksum, timestamp, size, uid, gid or permission
value after detected failure. This way monit is able to watch for
value recovery - on the other side following construct behavior
changed:

CHECK FILE httpd.conf WITH PATH /usr/local/apache/conf/httpd.conf
 IF FAILED CHECKSUM THEN EXEC "/usr/local/apache/bin/apachectl graceful"

In previous monit version this configuration caused the apache reload
on monitored configuration file change. Then the value was reseted so
the test passed next cycles until the file was changed again.
Refactored event engine monitors for checksum value recovery, i.e whether it changed to the original value - in such case it will evaluate recovery action, otherwise the test keeps failed state. Because the value in this usage context will not correspond to the original, monit will evaluate action (reload apache) each cycle until the checksum will recover (which is unlikely for configuration file).
--8<--

Problem is in present syntax. I think it will be good to strictly separate 'changes' and 'failed' aimed tests, and generaly consolidate syntax like this:

(1) IF FAILED rule THEN action [ELSE IF RECOVERED THEN action]
(2) IF CHANGED rule THEN action

... in the case (1) will monit watch constant value of 'rule' in the failed/passed state sense.

... in the case (2) is monit aimed to changes only, i.e. the rule variable value is reseted and action evaluated each time its change is detected.


This will involve syntax change of 'checksum', 'size' and 'timestamp' tests syntax, which are ommiting FAILED word in the rule definition currently.

For example suppose timestamp test:

PRESENT SYNTAX:
  IF TIMESTAMP [CHANGED|operator NUMBER value] THEN action
 [ELSE IF RECOVERED THEN action]

PROPOSED SYNTAX:
1.) constant value test:
  IF FAILED TIMESTAMP [operator NUMBER value] THEN action
 [ELSE IF RECOVERED THEN action]

2.) variable value test (aimed to testing changes - value is reseted):
  IF CHANGED TIMESTAMP THEN action


What do you think?

Martin




reply via email to

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