<应用>:概览
<接口地址>:/siteapi/data/sitetask/lasttimecheckinfos
<MySQL>:从库
<请求方式>:GET
<请求类型>:URL参数
<响应类型>:JSON
<请求参数>:
参数名称 | 是否必须 | 类型 | 默认值 | 描述 |
task_id | 是 | int | 无 | 任务编号 |
<请求示例>:
curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa" https://v6-api.jiankongbao.com/siteapi/data/sitetask/lasttimecheckinfos?task_id=64
<响应数据>:
参数名称 | 数据类型 | 描述 |
cntGroupByResult | Array | 监测点检测结果数量分布 "1": 正常监测点数, "2": 异常监测点数, "3": 监测点维护中数量, "total": 有数据的监测点总数 |
cntGroupByIsp | Array | 监测点检测结果按运营商和结果分布 { "name": "电信", "monitorCnt": 监测点数量, "abnormalCnt": 异常监测点结果数量, "normalCnt":正常监测点结果数量 "maintainCnt":是否维护中 1是,0否 }, |
data | Array | 数据的Key值可以说明含义 { "monitor_id": 1, "monitor_name": "陕西西安电信", "location_name": "西安市", "isp_name": "电信", "monitor_status": "监测点状态",//1可用(正常&问题),0维护中 "isp_id": "1", "check_time": "11313",//最近一次检查时间 "monitorIp": "devmonitor.jiankongbao.com", "result": "1", //1-响应正常;2-响应不正常 "resp_time": "215.389", "status": "200 OK", “primary_ip”:”102.202.5.20” 响应服务器ip "resp_summary": { "dns_time": "1.16", "connect_time": "60.01", "process_time": "65.55", "download_time": "0.10", "total_time": "126.82", "size_download": "0.22", "speed_download": "1.75", "appconnect_time": "182.69" //SSL握手时间(此响应参数仅适用于HTTPS类型监控任务) } }, // HTTP/HTTPS监控任务响应结果 "resp_summary": { "res": "[\"\",\"; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> www.sina.com A\",\";; global options: +cmd\",\";; Got answer:\",\";; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27423\",\";; flags: qr rd ra; QUERY: 1, ANSWER: 17, AUTHORITY: 0, ADDITIONAL: 0\",\"\",\";; QUESTION SECTION:\",\";www.sina.com.\\t\\t\\tIN\\tA\",\"\",\";; ANSWER SECTION:\",\"www.sina.com.\\t\\t37\\tIN\\tCNAME\\tus.sina.com.cn.\",\"us.sina.com.cn.\\t\\t25\\tIN\\tCNAME\\twwwus.sina.com.\",\"wwwus.sina.com.\\t\\t25\\tIN\\tCNAME\\tww1.sinaimg.cn.w.alikunlun.com.\",\"ww1.sinaimg.cn.w.alikunlun.com.\\t17 IN\\tA\\t124.239.239.228\",\"ww1.sinaimg.cn.w.alikunlun.com.\\t17 "answerfrom": /// "222.222.222.222", "__sid": 80, "mip": "10.0.1.97" }// DNS监控任务响应结果 |
<响应示例>:
{ "cntGroupByResult": { "1": 1, "2": 0, "total": 1 }, "cntGroupByIsp": [ { "name": "电信", "monitorCnt": 1, "abnormalCnt": 0, "normalCnt": 1 } ], "data": [ { "monitor_id": 11, "monitor_name": "上海市电信", "location_name": "上海", "isp_name": "电信", "isp_id": "1", "monitorIp": "101.227.83.20", "result": "1", "primary_ip":"102.202.5.20", "resp_time": 36.31, "status": "200 OK", "resp_summary": { "dns_time": "1.16", "connect_time": "60.01", "process_time": "65.55", "download_time": "0.10", "total_time": "126.82", "size_download": "0.22", "speed_download": "1.75", "appconnect_time": "182.69" } }, ] }
<应用>:任务概览-监测点数据
<接口地址>:/siteapi/data/sitetask/batchlasttimecheckinfos
<MySQL>: 从库
<请求方式>:GET
<数据类型>:JSON
<响应类型>:JSON
<请求参数>:
参数名称 | 是否必须 | 类型 | 默认值 | 描述 |
task_ids | 是 | string | 无 | 任务id,批量任务id需要逗号隔开,最多支持100个任务 |
<响应数据>:
参数名称 | 数据类型 | 描述 |
data | Array | 返回结果 |
task_id | Int | 任务id |
task_type | string | 任务类型 |
monitor_count | string | 监测点总数 |
monitor_avail_count | string | 结果为可用的监测点数 |
monitor_disable_coun | string | 结果为不可用的监测点数 |
avail_rate | string | 监测点可用率 |
resp_time_max | string | 最大响应时间 |
resp_time_min | string | 最小响应时间 |
resp_time_avg | string | 平均响应时间 |
loss_max | string | 最大丢包率 |
loss_min | string | 最小丢包率 |
loss_avg | string | 平均丢包率 |
data_monitor_info | Array | 当下任务的最后一次检测详情 |
monitor_id | int | 监测点id |
result | int | 响应结果1正常2异常 |
resp_time | Int | 响应时间ms |
status | string | 相应状态 |
check_time | String | 检测时间 |
monitor_status | Int | 监测点状态 |
primary_ip | string | Ip
|
resp_summary | array | 响应具体指标 |
dns_time | string | dns解析时间 |
connect_time | string | 连接时间 |
download_time | string | 内容下载时间 |
total_time | String | 总时间 |
size_download | String | 内容下载大小 |
speed_download | string | 内容下载速度 |
process_time | string | 首字节时间 |
loss | string | 丢包率(仅ping任务) |
monitor_name | String | 监测点名称 |
appconnect_time
| float | SSL握手时间(此响应参数仅适用于HTTPS类型监控任务)
|
<响应示例>:
{ "data":[ { "task_id":"6924512", "task_type": "http", "monitor_count": "206", "monitor_avail_count": "0", "monitor_disable_count": "206", "avail_rate": "0", "resp_time_max": "2834.83", "resp_time_min": "49.72", "resp_time_avg": "1022.96", "loss_avg": "", "loss_min": "", "loss_max": "" "data_monitor_info":[ { "monitor_id":1, "result":2, "resp_time":0, "status":"404 Not Found", "check_time":"1605617205", "monitor_status":1, "primary_ip":"106.117.244.228", “” "resp_summary":{ "dns_time":"6.71", "connect_time":"13.55", "download_time":"0.35", "total_time":"68.04", "size_download":"2.61", "speed_download":"42.50", "process_time":"47.42" } , "monitor_name": "广东深圳电信" }, ... ] }, { "task_id":"6924519", "task_type": "ping", "monitor_count": "209", "monitor_avail_count": "207", "monitor_disable_count": "2", "avail_rate": "99.04", "resp_time_max": "418.4", "resp_time_min": "5.8", "resp_time_avg": "243.65", "loss_avg": "15.12", "loss_min": "0", "loss_max": "100" "data_monitor_info":[ { "monitor_id":1, "result":1, "resp_time":1, "status":"302 Move temporarily", "check_time":"1605617205", "monitor_status":1, "primary_ip":"219.136.244.121", "resp_summary":{ "dns_time":"3.22", "connect_time":"42.09", "download_time":"0.11", "total_time":"189.96", "size_download":"0.25", "speed_download":"1.33", "appconnect_time":"100.97", "process_time":"43.56" }, "monitor_name": "四川成都电信" }, ... ] }, { "task_id":"6924580", "task_type": "traceroute", "monitor_count": "0", "monitor_avail_count": "0", "monitor_disable_count": "0", "avail_rate": "0", "resp_time_max": "0", "resp_time_min": "0", "resp_time_avg": "0", "loss_avg": "", "loss_min": "", "loss_max": "" "data_monitor_info":[ ] }, ] }