This is Monit 5.26.0.
The issue is that EXEC is running twice, both on transition to failure, and the transition back to success. This behavior was expected prior to 5.16 (when "repeat" functionality was released) so I'm not sure why it's happening with 5.26.
Check statement as below:
CHECK PROGRAM mytest PATH /testcommand.sh
IF STATUS != 0 THEN EXEC "/fixcommand1.sh"
IF STATUS != 0 THEN EXEC "/notify_bad.sh"
ELSE IF SUCCEEDED THEN EXEC "/notify_good.sh"
The EXEC of the notify scripts send an email with a timestamp in it, and the duplicate notifications have the exact same time in them.
Any idea why this would be happening?
Check the used "set alert" definition, Monit send an alert for status changes and execute a command in your sample.