Is there a way in Thruk to extract the 'Expanded command' somewhere, via JSON, REST, or curl?

207 Views Asked by At

It shows up on the page, and I can see it in view source on chrome, but I do not appear to be able to get this info via curl, as the page stops loading - probably due to the JSON/js involved in formatting the page.

is there a way to obtain this information via either rest, JSON, or curling?

1

There are 1 best solutions below

1
sni On

There is a rest endpoint for this https://thruk.org/documentation/rest.html#_get-hosts-name-commandline for hosts and https://thruk.org/documentation/rest.html#_get-services-host-service-commandline for services.

Available from 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"
   }
]

The same information is available by curl from https://thrukhost/thruk/r/hosts/localhost/commandline