I have problems with monitoring nginx. Monit can monitor nginx and display resources usage (RAM usage, etc.), but is unable to start/stop nginx. I get only a simple message: "Execution failed". Syslog doesn't tell any more information.
My monitrc configuration file:
check process nginx with pidfile /var/run/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
group www-data
Restarting any other monitored program (eg. dovecot) works. Also, manually running nginx works
/etc/init.d/nginx start
Syslog:
May 5 17:47:45 vm7508 monit[7079]: restart service 'nginx' on user request
May 5 17:47:45 vm7508 monit[7079]: monit daemon at 7079 awakened
May 5 17:47:45 vm7508 monit[7079]: Awakened by User defined signal 1
May 5 17:47:45 vm7508 monit[7079]: 'nginx' trying to restart
May 5 17:47:45 vm7508 monit[7079]: 'nginx' stop: /etc/init.d/nginx
May 5 17:48:15 vm7508 monit[7079]: 'nginx' failed to stop
May 5 17:48:15 vm7508 monit[7079]: 'nginx' restart action done
Thanks.
vim -b monitrc
. The "-b" option for vim will show non-printable characters. Additionally, are there any useful messages in /var/log/messages or the nginx log?