monit-general
[Top][All Lists]
Advanced

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

Run action at certain time *only* once *and* system state


From: Eric Montellese
Subject: Run action at certain time *only* once *and* system state
Date: Fri, 11 Sep 2020 15:33:21 -0400

Hello all,

I can check for a certain system state:
https://mmonit.com/monit/documentation/monit.html#System

And I can run a check during a certain time period using the cron-style of service poll time:
https://mmonit.com/monit/documentation/monit.html#SERVICE-POLL-TIME

And I can trigger a check to occur only once by checking the timestamp of a file:
https://mmonit.com/monit/documentation/monit.html#TIMESTAMP-TEST
(in the 'start' function, I touch a file -- then I can check the timestamp of the file to determine how long it has been since the program was run).

But I'm having a difficult time seeing how to put all of this into a single check. 

the overall goal is to:
1. run an update script once (and only once) per night
2. at a random point between certain hours (sometime between 1am-2am, for example)
3. but only if the system load is below a certain threshold

I can accomplish this with various workarounds or by doing some of these checks within the called script -- but it "feels like" something monit should be able to do cleanly and that I'm missing something.  Am I?

I see a related question in the archives here:
https://lists.nongnu.org/archive/html/monit-general/2015-10/msg00044.html
from 2015.

Thanks for any advice,
Eric

reply via email to

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