Monit sets spartan environment/sandbox when starting programs (for security reasons) ... you are most probably missing some environment variables.

See: http://mmonit.com/wiki/Monit/FAQ#execution

Martin


On Sep 15, 2009, at 1:13 PM, Amit Gupta 15 wrote:

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


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to