URI | /v2/site/historySnapshot/{task_id}.json |
Method | GET |
参数说明 |
'task_id' => 网站监控项目ID(注:通过网站监控任务列表得到) 'start_date' => 开始日期(Y-m-d 默认当天) 'end_date' => 结束日期(Y-m-d 默认当天) 'monitor' => 指定监测点ID (可选参数,不填返回所有监测点数据, 通过网站监控任务可使用的监测点得到) 'page' => 分页参数 (可选参数,默认为1,每页返回50条记录) |
结果(json) |
网站(HTTP/HTTPS): { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 响应时间, 'dns_time' => "DNS域名解析时间, 'connect_time' => 建立连接时间, 'process_time' => 服务器计算时间, 'download_time' => 内容下载时间, 'total_time' => 响应总时间, 'size_download' => 下载字节数, 'speed_download' => 下载速度, 'resp_summary' => 当前监控概要 { (根据不同的监控任务返回不同的概要内容) }, } }, …… } }, ……. } Ping: { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 响应时间, 'resp_summary' => 当前监控概要 { 'target_ip' => 主机IP, 'bytes_per_request' => 数据包大小, 'bytes_total' => 总数据包大小, 'ttl' => TTL值, 'raw_data' => Ping快照 [ (根据不同的监控任务返回不同的快照内容) ], 'transmitted' => 发送的包数, 'received' => 收到的包数, 'loss' => 丢包数, } }, …… } }, ……. } FTP: { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 响应时间, 'resp_summary' => 当前监控概要 { (根据不同的监控任务返回不同的概要内容) }, } }, …… } }, ……. } DNS: { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 解析时间, 'resp_summary' => 当前监控概要 { 'res' => DNS结果快照 [ (根据不同的监控任务返回不同的快照内容) ], 'answerfrom' => DNS解析服务器 } }, …… } }, ……. } TCP/UDP/SMTP: { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 解析时间, 'resp_summary' => 当前监控概要 { (根据不同的监控任务返回不同的快照内容) } }, …… } }, ……. } Traceroute: { 监测点ID => { 'monitor_name' => 监测点 { 'title' => 监测点名称 }, 监测结果 => { 监测时间 => //unix时间戳 { 'resp_result' => 结果, 'resp_status' => 状态, 'resp_time' => 解析时间, 'resp_summary' => 当前监控概要 { 'raw_data' => TraceRoute快照 [ (根据不同的监控任务返回不同的快照内容) ], 'no_resps' => 没响应跳数, 'steps' => 跳数, 'max_loss' => 最大丢包, 'loss' => 丢包数, } }, …… } }, ……. } |
一个例子
curl -s "https://api.jiankongbao.com/v2/site/historySnapshot/705433.json?start_date=2014-12-29&end_date=2014-12-30&access_token=27c7e502c94cb1c2e3d8a3a2c7dba4ef14dc53cb"
说明:access_token通过获取访问token得到.task_id通过网站监控任务列表得到.
返回结果
{ "1": { "monitor_name": { "title": "西安电信" }, "check_result": { "1419354059": { "resp_result": "1", "resp_status": "200 OK", "resp_time": "158.53", "dns_time": "9.58", "connect_time": "36.59", "process_time": "38.71", "download_time": "73.64", "total_time": "158.53", "size_download": "23.30", "speed_download": "156.36", "resp_summary": { "url": "http://180.97.33.107", "content_type": "text/html; charset=utf-8", "http_code": 200, "header_size": 985, "request_size": 178, "filetime": -1, "ssl_verify_result": 0, "redirect_count": 0, "total_time": 158.529, "namelookup_time": 9.579, "connect_time": 46.172, "pretransfer_time": 46.197, "size_upload": 0, "size_download": 23855, "speed_download": 160111, "speed_upload": 0, "download_content_length": 0, "upload_content_length": 0, "starttransfer_time": 84.886, "redirect_time": 0, "req_headers": [], "req_method": "GET", "req_httpv": "1.1", "ip": "180.97.33.107", "resp_httpv": "1.1", "resp_headers": { "Date": "Tue, 23 Dec 2014 17:01:00 GMT", "Content-Type": "text/html; charset=utf-8", "Transfer-Encoding": "chunked", "Connection": "Keep-Alive", "Vary": "Accept-Encoding", "P3P": "CP=\" OTI DSP COR IVA OUR IND COM \"", "Cache-Control": "private", "Cxy_all": "baidu+646b76ca5a75fe5939af22f4850ed04b", "Expires": "Tue, 23 Dec 2014 17:00:29 GMT", "X-Powered-By": "HPHP", "Server": "BWS/1.1", "BDPAGETYPE": "1", "BDQID": "0x835ae70e0000b793", "BDUSERID": "0", "Content-Encoding": "gzip", "Set-Cookie": "BAIDUID=2994EB93E9D9666E87E710762968CD85:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com, BAIDUPSID=2994EB93E9D9666E87E710762968CD85; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com, BDSVRTM=0; path=/, BD_HOME=0; path=/, H_PS_PSSID=10147_1429_10166_10571_10399_10213_10500_10496_10753_10647_10458_10219_10686_9374_10355_10667_10096_10657_10443_10699_10404_10360_10619_10701_10627; path=/; domain=.baidu.com" }, "__sid": 90 } }, .... } }, ...... }