monit-general
[Top][All Lists]
Advanced

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

Re: Need help with monit script


From: Martin Pala
Subject: Re: Need help with monit script
Date: Fri, 01 Oct 2004 21:30:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040924 Debian/1.7.3-2

There is no native support for this - monit will send alert on first error currently. We plan to add support for custom error levels and related actions (i.e. do different actions based on error ratio) in the future.

However you can use monit 'exec' action to call script which will count errors and cycles and do appropriate action (e.g. alert) based on error severity/recurrence.

Example:

--8<--
 check host server1 with address 1.2.3.4
  if failed icmp type echo with timeout 15 seconds
  then exec "/path/to/my/event_handler"
--8<--

You can use environment variables (see manual - for example http://www.tildeslash.com/monit/monit.html#environment) in the event_handler script to see what happened and to do what you need (e.g. wait for two recurrent events before sending alert from this script, etc.)

Martin

Richie wrote:
Hello,

Is it possible to configure monit so that it'll trigger the alert if there are 2 consecutive icmp failures (within 2 cycles)?

check host SERVER1 with address 192.168.0.1
    if failed icmp type echo with timeout 15 seconds
        then alert
    alert address@hidden
        with mail-format {
              from:     address@hidden
              subject:  $EVENT - $ACTION
      }

Thanks,
R-




reply via email to

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