[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit] Running A Status Check script

From: Morgan, Blaine
Subject: [monit] Running A Status Check script
Date: Mon, 23 Jun 2008 13:25:45 -0700

Hello Monit users and devs,

I am trying to run a status checking app at regular intervals.  I came
up with the following kludge.

check process MyServerApp with pidfile /blah/
    start program = "/moreBlah/runMyService.init start"
    stop program  = "/moreBlah/runMyService.init stop"
    #The following is a hack to make monit run checkService once a
    #assuming a 30 second cycle time, the else an attempt to avoid a
spurious alert
    if loadavg(5min) > 0 for 2 cycles then
        exec "/moreBlah/checkMyService "
        else if passed 1 times within 1 cycle then exec "/bin/echo nop >
    depends on MyServerApp.status

check file MyServerApp.status with path /blah/MyServerApp.status
   if timestamp > 5 minutes then restart

This mostly works, but I get a spurious alert every time I restart

Resource limit matched Service MyServerApp

        Date:        Mon, 23 Jun 2008 12:11:05 -0700
        Action:      exec
        Host:        myHost
        Description: 'MyServerApp' loadavg(5min) of 1.5 matches resource
limit [loadavg(5min)>0.0]

Your faithful employee,

Am I taking the completely wrong approach here as a newbie monit user?
Or would it be useful for monit to be able to run an external check
application, and if so what is the best way to submit a patch as I will
add it myself.  But, I do not want a patch that no one else wants and I
have to keep adding with each release.

Currently we run the Status checking in cron, but if you stop
MyServerApp, it would be nice to automatically stop checking the status
and that makes me think I should be running it from Monit.

Thanks for a great tool,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]