monit-dev
[Top][All Lists]
Advanced

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

service "up" event support


From: Martin Pala
Subject: service "up" event support
Date: Mon, 22 Mar 2004 22:30:03 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312 Debian/1.6-3

Hi,

here is first preview of event handler refactoring. It compiles, roughly works and is tested softly. Because the event engine refactoring affected the code base a lot, lot of bugs are expected to appear.

Syntax is backward compatible (for example):

  IF rule THEN action [ELSE IF RECOVERED THEN action]

  if failed checksum then exec "/grey/hound start"
  else if recovered then exec "/grey/hound stop"

The part [else if recovered ...] is optional. In the case that it is ommited, alert action is supposed as default on recovery, thus following rules are equivalent:

  if failed checksum then alert

  if failed checksum then alert else if recovered then alert


The behaviour changed externaly and internaly - event engine is general, evets and actions are strictly separated, some were added, some removed and some changed.

Syntax, alert output, etc. are tentative - it is possible to change it.


In the case of problem, monit will do appropriate action, for example if monitored process doesn't exist any more, it will restart it (default action for EVENT_NONEXIST is ACTION_RESTART) and send alert:

--
Subject: monit alert --  Does not exist slapd

Does not exist Service slapd

        Date:   Mon, 22 Mar 2004 22:18:30 +0100
        Action: restart
        Host:   unicorn

Your faithful employee,
monit

Process 'slapd' is not running
--

and as soon as the service is up again (EVENT_NONEXIST is not true any more), it will send alert (default action for EVENT_NONEXIST recovery is ACTION_ALERT)

--
Subject: monit alert --  Exists slapd
Exists Service slapd

        Date:   Mon, 22 Mar 2004 22:18:35 +0100
        Action: alert
        Host:   unicorn

Your faithful employee,
monit

Process 'slapd' is running with pid 11056
--


If you agree with the architecture, i can commit it to cvs after 4.2 will be released.


Patch testing, fixes, etc. are highly appreciated :)


TODO:
- extensive testing
- documentation (behaviour and syntax)



Martin

Attachment: event_handling.patch
Description: application/unknown


reply via email to

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