拓冰建站拓冰建站
首页 / 资讯中心 / 正文

monit设置邮件频率和短信警报

一、monit 配置邮件发送频率1.1 增加心跳周期 默认为60s 改为120s可适当在增加代码语言javascriptAI代码解释set daemon 1201.2 增加进程检测周期 将默认的代码语言javascriptAI代码解释check system 192.168.16.204 if loadavg (1min) 6 if loadavg (5min) 4 if memory usage 95% if swap usage 95% if cpu usage (user) 95% if cpu usage (system) 95% if cpu usage (wait) 95%改为如果三次或更多都达到警报条件则报警代码语言javascriptAI代码解释check system 192.168.16.204 if loadavg (1min) 6 for 3 cycles then alert if loadavg (5min) 4 for 3 cycles then alert if memory usage 95% for 3 cycles then alert if swap usage 95% for 3 cycles then alert if cpu usage (user) 95% for 3 cycles then alert if cpu usage (system) 95% for 3 cycles then alert if cpu usage (wait) 95% for 3 cycles then alert二、monit发短信警报2.1 服务器安装curl代码语言javascriptAI代码解释yum install curl查看rpm -qa|grep curl2.2 发送短信脚本代码语言javascriptAI代码解释#!/bin/bash /usr/bin/curl -s -d api_idXXXX -d userXXXX -d password**** -d to86130******** -d text$* http://api.clickatell.com/http/sendmsg?配置例子代码语言javascriptAI代码解释check host localhost with address 192.168.16.204 if failed port 25 type tcp with timeout 10 seconds for 2 times within 3 cycles then exec /opt/sendsms localhost 192.168.16.204:25 connect failed!当senmail 关掉后 会收到短信localhost 192.168.16.204:25 connect failed!
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门