monit-general
[Top][All Lists]
Advanced

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

[monit] Restarting Apache from Monit


From: Amit Gupta 15
Subject: [monit] Restarting Apache from Monit
Date: Tue, 15 Sep 2009 16:43:50 +0530

Hi All,
 
 
I have installed monit in our environment from a user X. And I want to monitor Apache and restart the Apache, if there is no response. Apache is running from root.
 
I have also given sudo access to user X to start apache and written a script like below in monitrc, but it is not able to stop/start apache. I am able to re-start apache from user X without using monitrc.
 
check process apache with pidfile "/opt/apache/logs/httpd.pid"
        start = "/usr/bin/sudo /opt/apache/bin/httpd -k start"
        stop = "/usr/bin/sudo /opt/apache/bin/httpd -k stop"
 
        if failed host <IP-Address> port 80
        protocol http then restart
        if 5 restarts within 5 cycles then timeout
 
Any suggestions??
 
Thanks,
Amit
 
 

reply via email to

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