美文网首页
Centos Monit 使用教程

Centos Monit 使用教程

作者: 孙晨旭 | 来源:发表于2017-04-17 17:46 被阅读0次

官方示例地址

1.安装monit

yum install monit

2.配置monit

vim /etc/monit.conf

set logfile /var/log/monit.log #日志文件

set httpd port 2812 and            # 设置http监控页面的端口

    use address www.example.com  #http监控页面的IP或域名

    allow 58.68.78.0/24          # 允许此IP段访问

    ##allow 0.0.0.0/0.0.0.0      # 允许任何IP段,不建议这样干

   allow userxxx:passwordxxx    # 访问用户名密码

3.添加一个Nginx进程监控

set daemon 30 #检查周期,可以根据需要自行调节,这里把它改成30秒

check process nginx with pidfile /var/run/nginx.pid #添加nginx进程pid文件信息

    start program ="/etc/init.d/nginx start" #进程启动命令行,注:必须是命令全路径

    stop program ="/etc/init.d/nginx stop" #进程结束命令行,注:必须是命令全路径

sudo monit -c /etc/monit.conf #启动monit

sudo monit quit #关闭monit

4.这样最简单的一个nginx进程监控就完成了,可以通过 www.example.com:2812 在网页上查看了

相关文章

网友评论

      本文标题:Centos Monit 使用教程

      本文链接:https://www.haomeiwen.com/subject/rtatzttx.html