[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: content match
From: |
Martin Pala |
Subject: |
Re: content match |
Date: |
Sat, 6 Jun 2015 13:51:54 +0200 |
Hello Petra,
there is no native support for pausing monitoring for x seconds after some
event occurred.
It is possible to wait for x errors before the event is triggered (i.e. require
multiple occurrences of the problem) - i’m not sure if it corresponds your
needs in this case, example usage:
if match “my_string” for 2 cycles then exec “my_command”
=> the “my_string” pattern will have to occur in the file for two consecutive
cycles before the “my_command” is executed.
If you need to execute the command on first error occurrence and pause the
monitoring you’ll need to “unmonitor” the service (“monit unmonitor
system.log”) … you can call this from your exec action’s script - to enable the
monitoring after x seconds, you’ll need to do “monit monitor system.log” - for
example scheduling it from the same script using “at”.
Regards,
Martin
> On 02 Jun 2015, at 10:53, Petra Humann <address@hidden> wrote:
>
> Hello,
>
> I have in monitrc:
>
> check file system.log with path /var/log/system.log
> if match "my_string" then exec "my_command"
>
> How can I pause the monitoring of this file for x seconds, if this condition
> occured once?
>
> Thank you very much.
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
- content match, Petra Humann, 2015/06/02
- Re: content match,
Martin Pala <=