Hello,
it seems like the json query
curl -s "user:pw@srvnagios01/nagios/cgi-bin/objectjson.cgi?query=hostgrouplist"
is not able to find empty hostgroups. Is this normal behaviour? It kind of messes up some of my script as I'm looking is a hostgroup exists with this, but it might be this hostgroup was very recently created...
Is there some json query that does find all the hostgroups including the empty ones?
Grtz
Willem
Json query for empty hostgroups
Json query for empty hostgroups
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Json query for empty hostgroups
Nagios Core discards the hostgroups with no members in them and they are not even shown in the web UI. In Nagios XI you see them, as the info is pulled from the database.
I was able to verify that by using the below query:
you are not going to be able to pull information about "empty" hostgroups. You could however use the Backend API component in XI to do so ("Hostgroups" URL).
I was able to verify that by using the below query:
Code: Select all
curl -s "user:pw@srvnagios01/nagios/cgi-bin/objectjson.cgi?query=hostgrouplist"Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Json query for empty hostgroups
Ok, I'll try the backend api. It would be nice though if it could be added to json, but I guess that would be a core feature requesst.
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Json query for empty hostgroups
Let us know if this works out for you.Ok, I'll try the backend api.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Json query for empty hostgroups
it doesn't really work out for me.. Seems it's not technically possible to get empty hostgroups with json, which just is not very practical. Please close this thread.
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net