monit-dev
[Top][All Lists]
Advanced

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

alert timeout


From: Martin
Subject: alert timeout
Date: Tue, 18 Feb 2003 10:21:11 +0100

Hi,

i saw yet one problem in monit 3.1 - if you have
perprocess timeout statement set and you use
either resource or timeout 'alert' action, if the
failure condition is fullfilled the timeout
statement doesn't apply to this process.

Problem is in do_validate():

...
          case ACTION_ALERT:
              smtp_alert_resource(p, "Reason: %s\n", report);
              /* We are also interested in other
alerts/stops/restarts! */
              pr->cycle=0;
              break;
...

Because cycle is incremented only in do_restart()
method which isn't used in that case, monit
ignores timeout statement and the alert message is
sent in every cycle, even if it matches timeout
statement.

The solution could be to do following modification
in timestamp and resource testing:

...
          case ACTION_ALERT:
              if(p->def_timeout) p->nstart++;
              smtp_alert_resource(p, "Reason: %s\n", report);
              /* We are also interested in other
alerts/stops/restarts! */
              pr->cycle=0;
              break;
...
      case ACTION_ALERT:
          if(p->def_timeout) p->nstart++;
          smtp_alert_timestamp(p, "Reason: %s\n", report);
          break; /* continue */
...

I'm on the training now without possibility to
test/add anything - please could be possible to
think about it before 3.2 release? If all
developers will be busy, i can look on it in the
evening :)

Cheers,
Martin






reply via email to

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