米发多端监控提供URL告警与恢复事件API回调通知,在监控URL发生失效或恢复时,可以收到来自米发的POST通知。

请求类型:POST

请求地址:监控项目设置的API回调地址

回调POST字段内容:

     "monitor_id": 监控项目ID,
     "url": 告警URL,
     "heartbeat": 当前心跳,up为可用,down为失效,
     "monitor_module_name": 报警模块内部名称,
     "occur_time": 发生时间 ISO-8601 格式 (如: 2019-10-10T06:00:00Z) 
     "occur_time_CN": 发生日期及时间,时区 Asia/Shanghai,如2019-10-10 12:10:00
     "reason": 简要原因,
     "monitoring_task": 监控项目信息(与监控查询接口返回一致,可参考多端监控API说明)

回调POST内容示例:

{
     "monitor_id": "0256fd2c-4875-4423-b2f0-93ba4e4f49ae",
     "url": "http://www.gc788.com/is",
     "heartbeat": "down",
     "monitor_module_name": "CnHttpMonitor",
     "occur_time":"2019-10-21T10:01:35Z",
     "occur_time_CN":"2019-10-21 18:01:35","
     "reason": "(56)Failure when receiving data from the peer",
     "monitoring_task": {
         "id": "0256fd2c-4875-4423-b2f0-93ba4e4f49ae",
         "host": "overseas.test.mfpad.com",
         "monitoring_name": "overseas.test.mfpad.com",
         "urls": [
             "http://www.mfpad.com/",
             "http://www.gc788.com/is",
             "https://www.facebook.com/",
             "https://www.google.com/"
         ],
         "urls_valid": [
             "http://www.mfpad.com/"
         ],
         "urls_invalid": [
             "http://www.gc788.com/is",
             "https://www.facebook.com/",
             "https://www.google.com/"
         ],
         "urls_invalid_on_monitors": {
             "WeChatMonitor": [
                 "http://www.gc788.com/is"
             ],
             "CnHttpMonitor": [
                 "https://www.facebook.com/",
                 "https://www.google.com/",
                 "http://www.gc788.com/is"
             ],
             "GlobalHttpMonitor": [
                 "http://www.newdomain1.com/",
                 "http://www.newdomain5.com/",
                 "http://www.gc788.com/now"
             ]
         },
         "monitoring_urls_amount_in_healthy": "4",
         "monitoring_config": {
             "interval": "1",
             "monitoring_name": "",
             "monitoring_urls": "1",
             "monitors": [
                 "WeChatMonitor",
                 "QQMonitor",
                 "CnHttpMonitor"
             ],
             "CnHttpMonitor": {
                 "interval": "0",
                 "timeout": "5000"
             },
             "GlobalHttpMonitor": {
                 "interval": "0",
                 "timeout": "1000"
             }
         },
         "notify_config": {
             "api": {
                 "endpoint": "https://www.mfpad.com/service/record_post"
             }
         },
         "enabled": "1",
         "next_run_times": {
             "WeChatMonitor": "2019-10-15 16:42:37",
             "CnHttpMonitor": "2019-10-15 16:43:37"
         },
         "create_time": "2019-10-06 19:06:46",
         "update_time": "2019-10-15 16:40:18"
     },
     "debug": {}
 }