UptimeRobot发送网站状态到钉钉消息通知

您所在的位置:网站首页 钉钉解封官网网址 UptimeRobot发送网站状态到钉钉消息通知

UptimeRobot发送网站状态到钉钉消息通知

2024-07-03 09:40| 来源: 网络整理| 查看: 265

  使用UptimeRobot监控网站状态,免费版可以添加50个网址,最短间隔5分钟。当网站不可访问时,可发送邮件通知。

  使用邮件通知时,管理员不一定会实时查看邮件。这时,可以使用一种更方便的方式,Webhook(Web钩子),当事件发生时,Web钩子自动发出HTTP POST请求。

  UptimeRobot支持Webhook方式发送通知,配置方式参考以下内容。

一、进入官网,并登录后台管理

  官网登录网址:https://uptimerobot.com/login

二、配置Webhook消息通知

打开My Settings窗口

找到Alert Contacts区域,点击Add Alert Contact按钮

选择通知方式为Webhook

配置Webhook接口信息

Friendly Name:必填,随便起个名称 URL to Notify:必填,Webhook接口网址,即接收请求的网址。这里必须以&结尾,需提前申请好钉钉的关键词安全设置 POST Value (JSON Format):非必填,但用于钉钉时必须填写,同时要选中 Send as JSON (application/json) Enable notifications for:通知类型 三、配置通知消息内容

  消息内容,即POST Value部分,支持的参数有:

*monitorID* (the ID of the monitor) *monitorURL* (the URL of the monitor) *monitorFriendlyName* (the friendly name of the monitor) *alertType* (1: down, 2: up, 3: SSL expiry notification) *alertTypeFriendlyName* (Down or Up) *alertDetails* (any info regarding the alert -if exists-) *alertDuration* (in seconds and only for up events) *alertDateTime* (in Unix timestamp) *monitorAlertContacts* (the alert contacts associated with the alert in the format of 457;2;[email protected] -alertContactID;alertContactType, alertContactValue) *sslExpiryDate* (only for SSL expiry notifications) *sslExpiryDaysLeft* (only for SSL expiry notifications)

  但这里要配置为JSON的格式,并且要包含钉钉的关键词。

{ "msgtype": "text", "text": { "content": "[xinac]\n\n网址:*monitorURL*\n名称:*monitorFriendlyName*\n状态:*alertTypeFriendlyName*\n详情:*alertDetails*\n持续:*alertDuration*\n时间:*alertDateTime*" } }

  将JSON填写到POST Value部分:

四、保存配置,修改网站的通知方式

  一定要修改网站的通知方式,不然是不会启用的。

五、效果预览

六、相关资料

  官网登录页面:https://uptimerobot.com/login

  钉钉群消息机器人Webhook接口使用方法:https://blog.xinac.cn/archives/dingtalk-webhook.html

  本站使用UptimeRobot监控网站状态:https://blog.xinac.cn/archives/uptimerobot.html



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3