linux 安装 monit 监控

这篇博客介绍了如何在Linux系统中通过yum安装monit,并详细说明了monit的配置过程,包括设置监控间隔、启动和停止服务的命令、查看服务状态的方法。同时,还展示了如何配置monit来监控nginx、redis和mysql这三个关键服务的步骤。
摘要由CSDN通过智能技术生成

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
  •   查看服务运行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值