搜索看看
数据开放接口 / 获取监控主机的自定义监控项列表
1、示例,下面【2】是参数说明:
请求URL:http://localhost:9999/customInfo/agentList 请求方式:POST 请求参数(Content-Type:application/json): { "wgToken":"65d05df102851c6535322e73b2f99c06", "hostname":"192.168.1.1" } 返回结果: { "msg":"", "code":"0", "data":[ { "hostname": "10.0.4.17", "customName": "网站证书到期时间剩余天数", "customShell": "sh /wgcloudTest/ssl.sh www.wgstart.com 443", "state": "1", "active": "1", "resultExp": "result < 20", "customValue": "89", "groupId": "1684065046667329536", "createTime": 1733976621000, "warnLevel": "ERROR", "id": "1777129156308500480", "page": 1, "pageSize": 20 } ] }
2、参数说明:
请求参数(Content-Type:application/json): { "wgToken":"必填,server/config/application.yml里的wgToken配置项的md5加密字符串,大小写均可", "hostname":"必填,主机ip,完全匹配,非模糊查询", } 返回结果: { "msg":"错误信息", "code":"0成功1错误", "data":[ { "hostname": "监控主机IP", "customName": "自定义监控项名称", "customShell": "自定义监控项执行的指令或者脚本", "state": "自定义监控项结果状态,1正常,2下线", "active": "监控状态,1监控中,2已停止", "resultExp": "告警表达式", "customValue": "监控结果", "groupId": "标签ID", "createTime": "添加时间,毫秒", "warnLevel": "告警级别", "id": "1777129156308500480" } ] }