0

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?

Ranjul Arumadi
  • 109
  • 1
  • 2
  • 11
  • I'm not familiar with `thruk` but if you can explain what the "expanded command" actually is, maybe it's possible to get it directly from the configuration or livestatus on the CLI – pzkpfw Apr 15 '21 at 09:53

1 Answers1

0

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

sni
  • 125
  • 6
  • we were running an old version without the rest interface, ended up downloading the pages using a browser based webdownloader, since curl wouldnt get them properly either, and then just grepped through them for the info. – AdaptiveSystemsUK Jul 29 '21 at 12:41