yum 安装
yum -y install epel-release
yum -y install monit
配置
修改文件: vim /etc/monitrc 或 vim /etc/monit.conf
- set daemon 60 //多久刷新一次
- #set log syslog
- set logfile /var/log/monit.log
- set httpd port 2812 and
- use address 172.20.10.11 //ip地址
- allow 0.0.0.0/0.0.0.0 //允许任何情况下访问
- allow admin:monit //账号密码
- #with ssl { # enable SSL/TLS and set path to server certificate
- # pemfile: /etc/ssl/certs/monit.pem
- #}
- include /etc/monit.d/*
命令
- 启动服务:systemctl start monit 或 service monit start 或 /usr/bin/monit -c /etc/monitrc
- 停止服务:systemctl stop monit
- 重启服务:systemctl restart monit
- 查看服务运行