monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Monitor timestamp only and not existence of file


From: Martin Pala
Subject: Re: [monit] Monitor timestamp only and not existence of file
Date: Tue, 9 Mar 2010 23:10:33 +0100

Hello,

which monit version exactly you use?

Regards,
Martin


On Mar 8, 2010, at 9:04 AM, Rishad Omar wrote:

> Hello,
> 
> I finally installed monit version 5 but can't get monit to stop alerting
> about file existence. 
> 
> Ideally, I just want an alert when there is a timeout. So, no alert on
> "exist" and "nonexist".
> 
> This is my configuration: 
>       check file mylock path /some/where/lock
>               if timestamp > 5 minutes 
>                       then exec "some command"
>               alert address@hidden only on { timestamp }
>               #alert address@hidden but not on { nonexist } ... tried this 
> too excl/incl the line above!
> 
> 
> I have looked at documentation as you suggested, Martin, but can't
> figure it out. I expected that "only on timeout" should exclude
> everything else.
> 
> Your help much appreciated. Rishad
> 
> 
> 
> On Thu, 2010-01-21 at 18:47 +0100, Martin Pala wrote:
>> Hello,
>> 
>> 
>> you can set mail filter to suppress existence alert:
>> 
>> 
>> alert address@hidden but not on { nonexist }
>> 
>> 
>> See manual for more details: 
>> http://www.mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement
>> 
>> 
>> Note: the "not" option requires monit-5.x
>> 
>> 
>> Regards,
>> Martin
>> 
>> 
>> 
>> On Jan 21, 2010, at 4:56 PM, Rishad Omar wrote:
>> 
>>> Hello,
>>> 
>>> 
>>> I'd like to monitor the timestamp of a file and execute my command
>>> when
>>> the file is 'old'. But I don't want to be alerted if the file exists
>>> nor
>>> if the the file doesn't exist. 
>>> That is, I want to be alerted ONLY if the file exists and is older
>>> than
>>> 10 mins.
>>> 
>>> The following works fine with the timestamp but in addition I get
>>> alerted when the file exists and then later that it doesn't exist.
>>> 
>>>       check file lock path /some/path/lock
>>>               if timestamp > 10 minutes
>>>                   then exec "/some/command"
>>> 
>>> I tried the following, but it hasn't helped:
>>> 
>>>       check file lock path /some/path/lock
>>>               start program = "/bin/touch /tmp/1.1"
>>>               if timestamp > 10 minutes
>>>                   then exec "/some/command"
>>> 
>>> Thanks, Rishad
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe:
>>> http://lists.nongnu.org/mailman/listinfo/monit-general
>>> 
>> 
>> --
>> 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]