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 <[email protected]> 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
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general