"REPEAT EVERY" not working as expected with "IF CONTENT"

Sebastian Arcus <[email protected]> Thu, 2 Oct 2025 18:30:36 +0100
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
I wonder if anyone can help. I am on Monit 5.34.4. I am using the 
configuration below to check on the 5G status of a 5G router:


CHECK PROGRAM 5g-check WITH PATH "/usr/bin/expect /etc/monit.d/5g-check"
  IF CONTENT != "NR5G" THEN EXEC "/usr/bin/expect /etc/monit.d/5g-reboot"
   REPEAT EVERY 60 CYCLES
NOT EVERY "* 23,0-6 * * *"


I thought (but I could be wrong) that the above should:

1. Run the 5g-check script every cycle

2. If the output doesn't contain "NR5G", run the 5g-reboot script

3. On the next cycle, if the output still doesn't contain "NR5G", do 
nothing - for the next 60 cycles

4. And then finally, skip the check completely between the hours 23-6


Something is not quite going to plan, as the "5g-reboot" script gets 
triggered repeatedly - instead of waiting for 60 cycles after the check 
fails initially. Does Monit somehow not remember the result of the last 
check, if using "IF CONTENT" maybe?