monit-general
[Top][All Lists]
Advanced

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

[monit] Monitor timestamp only and not existence of file


From: Rishad Omar
Subject: [monit] Monitor timestamp only and not existence of file
Date: Thu, 21 Jan 2010 17:56:57 +0200

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
        
        
        
        
        





reply via email to

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