monit-general
[Top][All Lists]
Advanced

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

Re: Monit - file checks with reminders


From: Ron Kelley
Subject: Re: Monit - file checks with reminders
Date: Thu, 12 Dec 2013 15:44:57 -0500

Thanks.  Let me give that a try and see if it helps.  Appreciate the pointer.


On Thu, Dec 12, 2013 at 3:17 PM, Rob Cotrone <address@hidden> wrote:
If you are overwriting the same log file, the inode may not be changing.

perhaps the cron job could rename/mv the old MegaRAID.log to MegaRAID.log.bak
Then create a new log.
That would insure a new inode is allocated.



On 12/12/2013 9:28 AM, Ron Kelley wrote:
Just to follow up on this.  I started monit with the "-v" flag (verbose), and this is what I get in the monit.log file:

'MegaRAID' content match skipped - file size nor inode has not changed since last test

It seems monit is having an issue noticing the file has been updated.  My script overwrites the MegaRAID.log file each time the cron job is run.  >From the monit man page:

FILE CONTENT TESTING
--------------------
The content is only being checked every cycle. If content is being added and removed between two checks they are unnoticed
On startup the read position is set to the end of the file and Monit continue to scan to the end of file on each cycle. But if the file size should decrease or inode change the read position is set to the start of the file.


Unless I read this wrong, the alert should be raised because the content of the file changed.


Thanks.

-Ron



On 12/12/13, 9:18 AM, Ron Kelley wrote:
Greetings all,

I searched through the archives and could not find an exact match to my problem.

I have monit v5.6 running on CentOS 6.3, and I am trying to get the "check file" function working with the reminder option.  For some reason, monit never sends a new alert on the reminder cycle.  Here is what I have:

-----------------------------------------------------------------------------
set daemon 30
set alert address@hidden
...
...
...
check file MegaRAID with path /var/log/MegaRAID.log
    alert address@hidden with reminder on 4 cycles
    if match "Degraded" then alert
    if match "Failed" then alert
-----------------------------------------------------------------------------

Monit will issue the first alert then will not alert anymore.  I have a cron job that runs every minute to get the RAID card status and put the result in the /var/log/MegaRAID.log file (thus, the file gets overwritten every minute).  Here is what the MegaRAID.log file looks like:

---------------------------------
LSI MegaRAID   Info - Thu Dec 12 09:06:04 EST 2013
---------------------------------
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Failed
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Online
                 State              : Partially Degraded
                 State              : Partially Degraded


Since this file is updated every minute, I was expecting to get an alert every 2 minutes (daemon at 30secs, with reminder on 4 cycles == thus, 2 mins).

Can someone please let me know what I need to do to get this working?

Thanks,

-Ron



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


reply via email to

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