monit-general
[Top][All Lists]
Advanced

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

Update status as heartbeat in external database.


From: Neelesh Pateriya
Subject: Update status as heartbeat in external database.
Date: Thu, 1 Nov 2012 23:00:49 -0700

Hi,

I am planning update status of process in an external database. I am working on config file that looks like 

check process crond with pidfile /var/run/crond.pid
    if  does not exist then exec "/bin/bash -c '/etc/init.d/cron restart; update_external_db.sh restarting' " ELSE IF SUCCEEDED then exec "/bin/bash -c 'update_external_db.sh restarted'"
    if uptime > 1 minutes then   exec "/bin/bash -c 'update_external_db.sh running' "  

It seems to be working fine. 
   If process stopped and not running     --> Status is updated to restarting. 
   Once process restarted successfully  --> Status is updated to restarted. 
   If process is up                                  --> Periadically status is updated to running.

This works fine. But only issue is because of uptime > 1 minutes check, status of process always remain as " Uptime failed" 

Is there any alternative approach so that we can periodically update status and status of process is also running?

Thanks,
NP


reply via email to

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