[Top][All Lists]

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

check file content without alert if file does not exist

From: Ben Soot
Subject: check file content without alert if file does not exist
Date: Wed, 24 Dec 2014 15:29:07 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


I am using monit 5.4 - cannot upgrade b/c shared c compiler lib of debian wheezy (would have to upgrade c compiler which i rather would not do b/c of side effects)

My issue:
I am checking several error log files and alert if certain patterns occur within (that indicate serious errors i need to take action on).
I however do not want to be alerted when the file does not exist (i.e. there 
are no errors at all)

How do i do that?

I tried:

check file foo-err.log  with path /foo-err.log
   if match
        "^.*ACTION_REQUIRED.*$" then alert
    if does not exist for 64 cycles then exec "/bin/true"

(the last clause is to override the default action which is restart and also 
alerts me.)

I am customer of mmonit, so i configure alert settings there.

So i configured to be alerted by all events except execution. However I still get alerted when the file does not exist.

Note also: I do not want to create an alert rule in mmonit for every service as i am monitoring a lot of such error log files.

Any ideas?

Many thxs and merry x-mas!


reply via email to

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