0

它显示在页面上,我可以在 chrome 上的查看源代码中看到它,但我似乎无法通过 curl 获取此信息,因为页面停止加载 - 可能是由于 JSON/js 涉及格式化页。

有没有办法通过 rest、JSON 或 curling 获取这些信息?

4

1 回答 1

0

此https://thruk.org/documentation/rest.html#_get-hosts-name-commandline 用于主机和 https://thruk.org/documentation/rest.html#_get-services-host有一个休息端点 -service-commandline 用于服务。

可从命令行获得:

thruk r /hosts/localhost/commandline 
[
   {
      "check_command" : "check-host-alive",
      "command_line" : "/omd/sites/devel/lib/monitoring-plugins/check_icmp -H 127.0.0.1 -w 3000.0,80% -c 5000.0,100% -p 5",
      "error" : "",
      "host_name" : "localhost",
      "peer_key" : "78bcd"
   }
]

curl 可以从 https://thrukhost/thruk/r/hosts/localhost/commandline 获得相同的信息

于 2021-07-28T07:01:58.707 回答