I am a newbie to monit and really love the tool - very useful.
I am facing an error when I run monit. The error is below: (I am running monit as root)
************************************* # ./monit status
/etc/monitrc:21: Error: the executable does not exist 'su' /etc/monitrc:22: Error: the executable does not exist 'su' /etc/monitrc:28: Error: the executable does not exist 'su' /etc/monitrc:29: Error: the executable does not exist 'su'
/etc/monitrc:35: Error: the executable does not exist 'su' /etc/monitrc:36: Error: the executable does not exist 'su' /etc/monitrc:42: Error: the executable does not exist 'cd' /etc/monitrc:43: Error: the executable does not exist 'su'
*************************************
Now what I have is a system with some scripts which are not in the init file. (They are not, need not be startup scripts)
Here is my monitrc file: *************************************
# vi /etc/monitrc "/etc/monitrc" 46 lines, 2159 characters set daemon 120 # Poll in 2-minute intervals set httpd port 2000 allow admin:sumonit
check process Apache with pidfile /usr/local/apache/logs/httpd.pid
group www start program = "/usr/local/apache/bin/httpd -f /usr/local/apache/conf/httpd.conf -k start" stop program = "/usr/local/apache/bin/httpd -f /usr/local/apache/conf/httpd.conf -k stop"
if failed host amp.twoliter.com port 80 protocol HTTP request "/index.html" then restart if 5 restarts within 5 cycles then timeout
check process sshd with pidfile /var/run/sshd.pid start program "/usr/lib/ssh/sshd" if failed port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout
check host Remediation_Test with address
amp.twoliter.com group www start program = "su - weblogic -c /opt/bea/user_projects/domains/cap2test/start" stop program = "su - weblogic -c /opt/bea/user_projects/domains/cap2test/stop"
if failed port 7005 protocol http and request "/console" then alert
check host AutoProvision_Test with address amp.twoliter.com group www
start program = "su - weblogic -c /opt/bea/user_projects/domains/cap3test/start" stop program = "su - weblogic -c /opt/bea/user_projects/domains/cap3test/stop" if failed port 7010 protocol http
and request "/console" then alert
check host AutoProvision_Dev with address amp.twoliter.com group www start program = "su - weblogic -c /opt/bea/user_projects/domains/cap3dev/start"
stop program = "su - weblogic -c /opt/bea/user_projects/domains/cap3dev/stop" if failed port 7020 protocol http and request "/console" then alert
check host Remediation_Dev with address
amp.twoliter.com group www start program = "cd /opt/bea/user_projects/domains/cap2dev; su weblogic -c \"nohup /opt/bea/user_projects/domains/cap2dev/startWebLogic.sh &\"; cd"
stop program = "su weblogic -c /opt/bea/user_projects/domains/cap2dev/stop" if failed port 7015 protocol http and request "/console" then alert
*************************************
What I am trying to do is this:
Run some processes as another user (weblogic). So for that I use "su weblogic"
I am also getting errors in the line bolded above... Weblogic looks for the config.xml
file in the current directory when it is started. Hence I am doing a cd and then running the startup script. While stopping, there is no such problem...