every cron cycles

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

every cron cycles

Robert Ehrenleitner
Hi,
 
I am not sure if I missed a thing, but the document says, that the syntax of the "every" keyword is either:
 
every NUM cycles
 
or
 
every CRON
 
However, I want a service to be monitored between, say, 7 am and 6 pm every 5 cycles.
 
Is there something like
 
every "0 7-18 * * *" 5 cycles
 
(according to the documentation, this is not syntactically correct).
 
I already tried simply putting the "every" keyword multiple times:
 
every "9 7-17 * * *"
every 5 cycles
 
which make monit reject the configuration file.
 
If there is really no chance in configuring this, it would be nice to see it put on the roadmap for the next release.
 
 

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: every cron cycles

David Jones
On 6/24/19 4:50 AM, Robert Ehrenleitner wrote:

> Hi,
> I am not sure if I missed a thing, but the document says, that the
> syntax of the "every" keyword is either:
> every NUM cycles
> or
> every CRON
> However, I want a service to be monitored between, say, 7 am and 6 pm
> every 5 cycles.
> Is there something like
> every "0 7-18 * * *" 5 cycles
> (according to the documentation, this is not syntactically correct).
> I already tried simply putting the "every" keyword multiple times:
> every "9 7-17 * * *"
> every 5 cycles
> which make monit reject the configuration file.
> If there is really no chance in configuring this, it would be nice to
> see it put on the roadmap for the next release.
>

I have this working today:

check program example with path "/bin/true" every 5 cycles
     if status != 0 for 2 cycles then alert
     not every "30-40 4 * * *"

I think you should be able to change the "not every" to your need and it
work fine.

--
David Jones
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Aw: Re: every cron cycles

Robert Ehrenleitner
Hi, David,
 
Thanks for pointing out that this should work. I should have tried before asking:
 
    if status notequal 0 for 3 times within 5 cycles then alert
    every "* 6-18 * * *"
    every 3 cycles
 
Boom, it really works in monit 5.25.2. Older versions rejected this.
 
 
Gesendet: Montag, 24. Juni 2019 um 19:05 Uhr
Von: "David Jones" <[hidden email]>
An: "[hidden email]" <[hidden email]>
Betreff: Re: every cron cycles
On 6/24/19 4:50 AM, Robert Ehrenleitner wrote:
> Hi,
> I am not sure if I missed a thing, but the document says, that the
> syntax of the "every" keyword is either:
> every NUM cycles
> or
> every CRON
> However, I want a service to be monitored between, say, 7 am and 6 pm
> every 5 cycles.
> Is there something like
> every "0 7-18 * * *" 5 cycles
> (according to the documentation, this is not syntactically correct).
> I already tried simply putting the "every" keyword multiple times:
> every "9 7-17 * * *"
> every 5 cycles
> which make monit reject the configuration file.
> If there is really no chance in configuring this, it would be nice to
> see it put on the roadmap for the next release.
>

I have this working today:

check program example with path "/bin/true" every 5 cycles
if status != 0 for 2 cycles then alert
not every "30-40 4 * * *"

I think you should be able to change the "not every" to your need and it
work fine.

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

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