搜索看看
数据开放接口 / 获取主机列表接口
1、示例,下面2是参数说明:
请求URL:http://localhost:9999/systemInfo/agentList 请求方式:POST 请求参数(Content-Type:application/json): { "wgToken":"65d05df102851c6535322e73b2f99c06", "hostname":"192.168.1.1", "orderBy":"CPU_PER", "orderType":"DESC", "page":1, "pageSize":10 } 返回结果: { "msg":"", "code":"0", "data":{ "total":10, "pages":1, "pageSize":10, "pageNum":1, "list":[ { "procs":"249", "totalSwapMem":"9.66G", "cpuPer":25, "hostnameExt":"DESKTOP-1BHHD8Q", "rxbyt":"0.7", "memPer":56, "netConnections":"267", "fiveLoad":0.69, "agentVer":"v3.3.6", "fifteenLoad":0.29, "uptimeStr":"3小时23分钟37秒", "hostname":"192.168.1.101", "bootTimeStr":"2021-12-25 11:02:28", "platformVersion":"10.0.19042 Build 19042", "submitSeconds":"30", "state":"1", "id":"1474588552871411712", "cpuXh":"Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz", "diskPer":44.44, "txbyt":"0.07", "bootTime":1640401348, "totalMem":"7.91G", "bytesSent":"0.01", "uptime":12217, "createTime":1640413570000, "bytesRecv":"0.15", "swapMemPer":"61.78", "platForm":"Microsoft Windows 10 Home China", "cpuCoreNum":"4", "remark": "工单系统" } ] } }
2、参数说明:
请求参数(Content-Type:application/json): { "wgToken":"必填,server/config/application.yml里的wgToken配置项的md5加密字符串,大小写均可", "hostname":"非必填,主机ip模糊搜索", "orderBy":"非必填,排序字段,如:CPU_PER,MEM_PER,TXBYT,RXBYT,TOTAL_MEM,CPU_CORE_NUM", "orderType":"非必填,降序或升序,DESC或ASC", "page":"必填,第几页", "pageSize":"必填,每页多少条" } 返回结果: { "msg":"错误信息", "code":"0成功1错误", "data":{ "total":"总数据条数", "pages":"总页数", "pageSize":"每页多少条", "pageNum":"第几页", "list":[ { "procs":"运行进程数量", "totalSwapMem":"交换区内存总大小", "cpuPer":"cpu使用率%", "hostnameExt":"主机名称", "rxbyt":"下行传输速率,KB/s", "memPer":"内存使用率%", "netConnections":"连接数量,包括tcp,udp,inet", "fiveLoad":"5分钟系统负载值", "agentVer":"agent版本", "fifteenLoad":"15分钟系统负载值", "uptimeStr":"运行时间,转为天小时分秒", "hostname":"主机IP", "bootTimeStr":"启动时间,转为年月日时分秒", "platformVersion":"系统版本详细信息", "submitSeconds":"agent上报时间间隔,秒", "state":"主机状态,1正常,2下线", "id":"1474588552871411712", "cpuXh":"CPU型号信息", "diskPer":"磁盘总使用率%", "txbyt":"上行传输速率,KB/s", "bootTime":"启动时间,秒", "totalMem":"内存总大小", "bytesSent":"发送流量G", "uptime":"运行时间,秒", "createTime":"更新时间,毫秒", "bytesRecv":"接收流量G", "swapMemPer":"交换区内存使用率%", "platForm":"系统版本详细信息", "cpuCoreNum":"core的个数(即核数)", "remark": "主机的备注说明" } ] } }