Json output of host object inspect

Hi all,

Not much experience with json but need to extract data to be able to use in an external platform.

This works fine for when I can see json in the pulldown menu, it shows up data OK, example:

(ip address)",“host_attempt”:“1/3”,“host_in_downtime”:“0”,“host_is_flapping”:“0”,“host_state_type”

But what I would like to do is see what I see when I inspect an object and see

Object Properties

then all the variables in a huge list, including the ‘groups’ variable that shows the host groups. Once I inspect an object and see this list there is no json output pulldown, is it possible to show this in a json format to be used externally?



there are various possibilities. Every scripting language has functions to handle json data structure. If you want to do this with bash you can try jq

Thanks will check that jq - but my question was more, can i output those variables of an object as a json object and then see it externally, and if so, how? As there is no pulldown menu for json as there are with other views, such as all services, hosts. I am specifically trying to output the variables that you see when you inspect an object into json format.

The output in icingaweb2 under “plugin output” is a text output. Or in other words, you’ll see it in that way how the used plugin output fromat the text. So there is no object tree to click arround, if you mean this.
I don’t know any other solutions than to use/write a check plugin which is filtering a json for specific key/values.

Maybe some other community members will have diffrent ideas for your requirment.

Thanks SS - as an example I mean this and being able to see the object properties variables in json from an external point:

Ok what you mean with the screenshoot is the check command definition via “inspect”-function, if the director is installed. This exists is not for the check plugin output.

I have no idea how to programm things like this for the check plugin output in icingaweb2. I think it would be difficult to have the output flexible for every kind return value. But hey, I’m not a dev :slight_smile: . If you think that would help us icinga users and you have and idea, why not create a feature request on Git? :wink: