monit-general
[Top][All Lists]
Advanced

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

Re: Local Alerts don't work without exec


From: Martin Pala
Subject: Re: Local Alerts don't work without exec
Date: Tue, 2 Oct 2007 21:31:44 +0200

The syntax is incorrect - see monit manual. The alert action doesn't allow to specify the target email on the testing rule directly. The recipients are listed with the standalone 'alert' (local) or 'set alert' (global) statement. The correct syntax thus is:

  check file server.log with path /foo/log/server.log
    if match ".*\s(ERROR|WARN)\s.*" then alert
    alert address@hidden

=> you specify the alert target once. The alert action in the rule then sends the alert to the recipient. The advantage of this syntax is obvious if you will add more testing rules, such as:

  check file server.log with path /foo/log/server.log
    if match ".*\s(ERROR|WARN)\s.*" then alert
    if timestamp > 1 hour then alert
    if size > 40 MB the exec "/bin/rotate  /foo/log/server.log"
    alert address@hidden

... all these rules generate alert, but you specified the target just once.

Martin


On Oct 2, 2007, at 10:57 AM, Nathan wrote:

Hi,

This will be the first of a few emails describing various problems with
the file content checking:

Problem 1
=========
Local alerts don't work unless there is an exec:

Here is the config:

check file server.log with path /foo/log/server.log
  if match ".*\s(ERROR|WARN)\s.*" then
    alert address@hidden


Monit reports "Error: parse error 'address@hidden'"

If I add an exec line in then it works, i.e.:

check file server.log with path /foo/log/server.log
  if match ".*\s(ERROR|WARN)\s.*" then
    exec "/bin/true"
    alert address@hidden


Is this a bug, or something I'm missing.

Thanks in advance,
Nathan


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

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