Monit repeat execution

Started by hazuki, February 02, 2025, 08:48:28 AM

Previous topic - Next topic
Hi

I want to set up monit to repeat execute a script when ping keeps failing. According to https://stackoverflow.com/questions/56011030/monit-only-executing-once, monit should be good for my purpose if "repeat" is defined in the syntax. However, with web GUI, my best attempt is to set the syntax to:

If failed count 5 size 64 with timeout 5 s via address <router IP> then exec '<some script>' (as seen in httpd). I don't see anywhere in Web GUI I can put "repeat" in to the syntax. How can I complete the syntax to

If failed count 5 size 64 with timeout 5 s via address <router IP> then exec '<some script>' repeat every cycle
Thanks in advance,
Hazuki

You can append repeat every cycle in the Path field, after <some script>.

Note that if you're already on 25.1, there is an issue which might prevent this from working. Should be fixed with the next update, or you can apply the patch manually:

opnsense-patch dd16ac0b2b5
Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Thanks Maurice! My bad I didn't mention the firmware version, and indeed it is 15.1.
The patch works like a charm and now everything works as expected.

Hazuki