Page 1 of 1

NagiosXI REST API for Hostgroup deatiled status

Posted: Sat Jan 27, 2018 11:17 am
by jackuna
Hello All,

I'm on my way to create a dashing dashboard for my Nagios XI Monitoring Status.
I can find almost all endpoints but the hostgroup summary endpoint is missing or i have missed something.

Current [ api-object-reference.php#objects-hostgroup ] just parses the Host group information with alias and name with ID, what i was looking for it's count of host and services with states, is there any thing like that.. I was using these customs within Icinga and it was really awesome.

Thanks

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Mon Jan 29, 2018 2:15 am
by tacolover101
i don't think you'll be able to get the count natively.

don't worry, you're not out of luck - a couple other options:
- you could make your own API endpoint
- parse status.dat with some beautiful greps and wc -l

this would make a pretty cool feature request though, especially as some places work to standardize configs with CI's / CMDB. helps to confirm data in the monitoring system.

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Mon Jan 29, 2018 2:17 am
by tacolover101
you may find this thread by @mcapra helpful - https://support.nagios.com/forum/viewto ... 71#p243022

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Mon Jan 29, 2018 4:44 am
by jackuna
Thanks for the suggestions, but i figured out very productive way to get host, hostgroup , servicegroup and many status , objects in JSON format using an existing tool that has been shipped with default Nagios Core and which comes along with NagiosXI default installation too.

One can find here.

https://your.server.ip/nagios/jsonquery.html
[email protected] here one can expect any query formatted in JSON, i have

'https://your.server.ip/nagios/cgi-bin/statusjson.cgi?query=hostcount&hoststatus=up+down+unreachable+pending like so on.


Thanks

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Mon Jan 29, 2018 12:21 pm
by kyang
Sounds good! Thanks for telling us your findings.

Glad to hear that it works for you though!

Did you have any more questions or are we okay to lock this up?

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Wed Jan 31, 2018 12:13 pm
by jackuna
Yes, you can close this thread as fixed.

Re: NagiosXI REST API for Hostgroup deatiled status

Posted: Wed Jan 31, 2018 12:16 pm
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!