Monit fails to timeout on program (5.16)

Issue #350 resolved
Vincent Ketelaars
created an issue

Monit fails to timeout on this program. It would also be nice if we could set alerts for deferred programs.

monitrc

set daemon 30

check program waiter
    with path test.sh with timeout 60 seconds
    every "* * * * *"
    if status != 0 then alert

test.sh

#!/bin/bash
echo "Something"
sleep 90
echo "Done"

Logs

'waiter' program started
'waiter' test skipped as current time (1461040409) does not match every's cron spec "* * * * *"
'waiter' status check defered - waiting on program to exit
'waiter' test skipped as current time (1461040469) does not match every's cron spec "* * * * *"
'waiter' status succeeded [status=0] -- Something
Done
'waiter' program started
'waiter' test skipped as current time (1461040529) does not match every's cron spec "* * * * *"
'waiter' status check defered - waiting on program to exit
'waiter' test skipped as current time (1461040589) does not match every's cron spec "* * * * *"
'waiter' status succeeded [status=0] -- Something
Done
'waiter' program started

Comments (3)

  1. Tildeslash repo owner

    Fix Issue #350 : If the "check program" used a custom schedule (based on "every" statement), the exit value evaluation and check for program timeout was deferred until the next cycle, which matched the schedule. Monit now collects the exit value ASAP (i.e. next cycle) and kills the program if timed out.

    → <<cset 1d9e92467ac3>>

  2. Log in to comment