Skip to content

MQPearth/web-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-monitor

通过以下三个指标判断目标网站是否正常

  1. 是否能在指定时间内正常建立连接以及返回内容

  2. HTTP Code 是否为200

  3. 网站响应内容不包含指定的字符

若出现异常会通过阿里云短信或企业微信进行通知

配置如下

{
  // 通知类型 1:阿里云短信 2:企业微信机器人
  "NotifyType": 1,
  // 企业微信机器人通知key
  "WeWorkKey": "xxxxx",
  // 阿里短信配置
  "EndPoint": "http://dysmsapi.aliyuncs.com",
  // 阿里短信配置
  "AccessKeyId": "*******",
  // 阿里短信配置
  "AccessKeySecret": "*******",
  // 阿里短信配置
  "SignName": "*******",
  // 阿里短信配置
  "TemplateCode": "*******",
  // 阿里短信配置
  "RegionId": "cn-shenzhen",
  // 通知目标
  "PhoneNumbers": "*******",
  // 关键字
  "HackedWords": [
    "ransom",
    "money"
  ],
  // 连接超时时间 示例: 300ms
  "ConnectionTimeout": 300000,
  // 内容读取时间 示例: 300ms
  "ReadTimeout": 300000
}

Run

./web-monitor -u http://localhost

Or

crontab -e

*/30 * * * * /web-monitor/web-monitor -u http://localhost:443 >> /web-monitor/log.txt

构建

mkdir build && cd build

cmake ..

// or
cmake -DCMAKE_BUILD_TYPE=Release ..

make

About

监控网站服务是否正常, 若出现异常则使用短信/企业微信机器人通知

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published