NagiosXI REST API for Hostgroup deatiled status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jackuna
Posts: 9
Joined: Thu Nov 02, 2017 12:51 am

NagiosXI REST API for Hostgroup deatiled status

Post 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
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: NagiosXI REST API for Hostgroup deatiled status

Post 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.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: NagiosXI REST API for Hostgroup deatiled status

Post by tacolover101 »

you may find this thread by @mcapra helpful - https://support.nagios.com/forum/viewto ... 71#p243022
jackuna
Posts: 9
Joined: Thu Nov 02, 2017 12:51 am

Re: NagiosXI REST API for Hostgroup deatiled status

Post 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
Last edited by jackuna on Wed Jan 31, 2018 12:12 pm, edited 2 times in total.
kyang

Re: NagiosXI REST API for Hostgroup deatiled status

Post 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?
jackuna
Posts: 9
Joined: Thu Nov 02, 2017 12:51 am

Re: NagiosXI REST API for Hostgroup deatiled status

Post by jackuna »

Yes, you can close this thread as fixed.
kyang

Re: NagiosXI REST API for Hostgroup deatiled status

Post 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!
Locked