monit-general
[Top][All Lists]
Advanced

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

Re: Multiple regexp in file content match path


From: Martin Pala
Subject: Re: Multiple regexp in file content match path
Date: Tue, 2 Oct 2007 23:11:35 +0200

Bug was fixed, current cvs version is available here:
https://savannah.nongnu.org/cvs/?group=monit

Martin

On Oct 2, 2007, at 10:12 PM, Martin Pala wrote:

Hi,

the exec action in the rule is not necessary ... you can rewrite the rule this way and monit will work:

  check file server.log with path /foo/log/server.log
    if match /etc/monit/foo.regexp then alert
    alert address@hidden

However, the reported assert is caused by monit bug, which happens when you use the match statement with regex file containing more then one statement and use the exec action.

Monit internals: monit expands the multiline regex file and add the 'if match ...' rule for each line with the same action. The exec argument was however assigned to the first line only so the second line will cause assert in monit configuration parser and monit won't start.

Workaround: if you need to use the multiple match statements with exec action, you can expand it by hand in monit configuration (i.e. one 'if match' statement per regex file line).

We are working on fix ...

Thanks,
Martin


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

..ok the next problem:

Should have said before, this is with the latest stable version of monit
(4.9)


From http://www.tildeslash.com/monit/doc/ manual.php#file_content_testing

"path is an absolute path to a file containing extended regular
expression on every line."

I assume that means you can have multiple regular expressions in the
file, one per line.


So I create a file, foo.regexp, containing the following:
.*\sERROR\s.*
.*\sWARN\s.*


I then have the following config:

check file server.log with path /foo/log/server.log
  if match /etc/monit/foo.regexp then
    exec "/bin/true"
    alert address@hidden


monit fails with the following output:

        AssertException: at p.y:2353
        aborting..
        Aborted


Is this a bug ?

Thanks in advance,
Nathan


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



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





reply via email to

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