RT!
基本是参照faq安装的http://www.iredmail.org/forum/topic565-faq-how-to-monitor-mail-related-service-with-monit.html
实际安装是centos 的64位二进制包,借用rpm中的脚本。
cd /usr/local/src
wget http://mmonit.com/monit/dist/binary/5.2 … x64.tar.gz
wget http://mirrors.sohu.com/fedora-epel/5/x … x86_64.rpm
mkdir -p /usr/local/src/monit
mv monit-4.10.1-8.el5.x86_64.rpm monit/
cd monit/
rpm2cpio monit-4.10.1-8.el5.x86_64.rpm | cpio -ivd
#设置管理文件。不是mont.conf,而是monitrc
cp etc/monit.conf /etc/monitrc
cp etc/rc.d/init.d/monit /etc/init.d/
tar -xvzf monit-5.2.5-linux-x64.tar.gz
cp ../monit-5.2.5/bin/monit /usr/bin/monit
而后
/etc/init.d/monit start
其余的都识别了。唯独这个sshd
我的是
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 59878 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
不知道为什么,就是报告not monitored
tail -20 /var/log/monit.log发现是
[CST Apr 23 01:56:47] error : 'sshd' process is not running
[CST Apr 23 01:56:47] info : 'sshd' trying to restart
[CST Apr 23 01:56:47] info : 'sshd' start: /etc/init.d/sshd
[CST Apr 23 01:57:17] error : 'sshd' failed to start
[CST Apr 23 01:58:17] error : 'sshd' service restarted 5 times within 5 cycles(s) - unmonitor
怪哉。我手动/etc/init.d/sshd start完全可以执行的!为什么monit就无法start呢??