在 Thruk 中是否有办法通过 JSON、REST 或 curl 在某处提取"扩展命令"?



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

有没有一种方法可以通过rest、JSON或curling获得这些信息?

这个有一个rest端点https://thruk.org/documentation/rest.html#_get-主机名命令行对于主机和https://thruk.org/documentation/rest.html#_get-服务主机服务命令行服务。

可从命令行获得:

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

最新更新