Add "kill" command in addition to stop

Issue #422 closed
jeremy mayes created an issue

We use a check program to determine if services should be running during a specific time range. The exit code of the check program determines the action monit should take. Because "stop" also "unmonitor"s, we can't use "if status = 100 then stop" and we have to duplicate the stop program specification. It would be nice to be able to say "if status = 100 then kill".

Comments (1)

  1. Tildeslash repo owner

    You can use an exec action instead of stop to execute custom program (such as kill):

    if status = 100 then exec '/usr/bin/pkill -9 myprogram'
    
  2. Log in to comment