标签:http io ar os 使用 sp strong on 文件
系统:centos7_x86_64
1.下载预编译的二进制文件mmonit和monit http://mmonit.com/download/
2.还需要安装一些库:
# yum install glibc.i686
# yum install libraries
# yum install libpam.so.0
3.解压,放到:/usr/local目录下:
/usr/local/mmonit-3.3/
/usr/local/ monit-5.10/
4.开启MMonit服务端:
/usr/local/mmonit-3.3/bin/mmonit start
5.开启Monit监控端、客户端:也可以单独使用
/usr/local/ monit-5.10//bin/monit start #发现报各种错,要修改下monit配置文件如下:
[root@bogon ~]# cat /usr/local/monit-5.10/conf/monitrc |grep -v ^# #-----------------------这部分就是简单的配置 set daemon 60 # check services at 1-minute intervals set logfile /var/log/monit.log set mailserver localhost # primary mailserver set eventqueue basedir /var/lib/monit/events # set the base directory where events will be stored slots 100 # optionally limit the queue size set mmonit http://monit:monit@192.168.182.130:8080/collector set alert xxxxxxxx@163.com # receive all alerts set httpd port 2812 and use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and allow admin:monit # require user ‘admin‘ with password ‘monit‘ #------------------------ # allow @monit # allow users of group ‘monit‘ to connect (rw) # allow @users readonly # allow users of group ‘users‘ to connect readonly #以下通过ping、80端口检测主机1.1 check host myserver with address 192.168.182.130 start program = "/usr/sbin/sshd -f /etc/ssh/sshd_config" stop program = "kill `cat /var/run/sshd.pid` " if failed ping then alert if failed port 80 then alert if failed port 3306 protocol mysql with timeout 15 seconds then alert if failed port 22 then start
标签:http io ar os 使用 sp strong on 文件
原文地址:http://my.oschina.net/jk409/blog/351579