monit-general
[Top][All Lists]
Advanced

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

Multiple 'every' clauses not working as expected


From: Aaron Lindsay
Subject: Multiple 'every' clauses not working as expected
Date: Fri, 1 Jan 2021 10:45:54 -0500

Hello and Happy New Year!

I am attempting to use multiple 'every' clauses to simultaneously control how frequent a 'program'-style check is made *and* what times of day it is run. Based on a previous mailing list discussion [0], I thought that using both a 'poll cycle multiple' and a 'negative cron-style' scheduling clause for a given service check would work. However, I'm finding (on monit 5.27.1) that it appears that when two 'every' clauses appear, only the later is effective. For example, the following check runs every 2nd cycle as intended, but does so even during hours 22-23,0-6 when it shouldn't:

check program test with path /path/to/monit_test.sh
    not every "* 22-23,0-6 * * *"
    every 2 cycles
    if status != 0 then alert

And the following doesn't run during 22-23,0-6, but runs *every* cycle otherwise:

check program test with path /path/to/monit_test.sh
    every 2 cycles
    not every "* 22-23,0-6 * * *"
    if status != 0 then alert

I've looked in the manual and searched the mailing list, but haven't been able to find a definitive answer to whether using duplicate 'every' clauses is intended to be supported in this way. Have I found a bug, or am I simply using this a way that it isn't intended?

(And if I'm just Doing It Wrong, is there a good way to both reduce how frequently a check is run (in terms of cycles) *and* limit it to certain times of day?)

Thanks for any help!

-Aaron

[0] https://lists.nongnu.org/archive/html/monit-general/2019-06/msg00022.html

reply via email to

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