解决办法是替换这一行文:
check process apache with pidfile /var/run/httpd.pid
加入:
check process httpd with pidfile /var/run/httpd/httpd.pid
我也删除了这批人。
Original post:
After installing Monit on CentOS, and setting an alert for the Apache (httpd) service, the service no longer creates the /var/run/httpd.pid file.
http://strong>。
其中,莫伊特人报告说,该服务状况如下:处决失败
当然,重新启动这种服务的唯一途径是杀害它,因为重新启用的文字看不到任何运行过程。
这些是/etc/monit.d/monitrc档案的内容:
set daemon 10
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: me@server.com }
set alert bugs@server.com
set httpd port 2812 and
# SSL ENABLE
# PEMFILE /var/certs/monit.pem
allow user:password
check process apache with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if cpu is greater than 180% for 1 cycles then alert
if totalmem > 1200 MB for 2 cycles then restart
if children > 250 then restart
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh for 5 cycles then restart
if 5 restarts within 25 cycles then timeout
“现役重启”的产出:
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
任何帮助都将受到高度赞赏。