Configuration Report for Host/Services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
MikeMAN987
Posts: 58
Joined: Fri Sep 29, 2017 9:57 am

Configuration Report for Host/Services

Post by MikeMAN987 »

Hello,

In our environment, we have thousands of checks that IT admins are constantly looking to tune. Often times I will get a request to generate a list of all alerts/checks for a specific host. Right now this is a very manual process between looking at hostgroups->template inheritance-> seeing if there are contacts on the template, seeing which thresholds are set etc. Is there a way to script/run this to export a "as running" configuration for specific hosts and their services? I know there is an inheritance model and we use that heavily but can I query, or from command line run a command like "give me host1" and it generates the configuration for itself and its services as Nagios XI is interpreting it?

Regards,
Mike
jforcier

Re: Configuration Report for Host/Services

Post by jforcier »

Try accessing Nagios Core by using this link, where xxx.xxx.xxx.xxx if the IP of the XI server:

Code: Select all

http://xxx.xxx.xxx.xxx/nagios/
Once you are logged in, click on 'Configuration' on the left hand menu under 'System'. This will provide a table of all the hosts/services and their configurations. Is this what you were thinking of?
MikeMAN987
Posts: 58
Joined: Fri Sep 29, 2017 9:57 am

Re: Configuration Report for Host/Services

Post by MikeMAN987 »

Thanks for this. Never occurred to me to use the existing underlying core system to also help pull data. I'm not sure this is showing what "nagios" see's however after it inherits all its templates?
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: Configuration Report for Host/Services

Post by optionstechnology »

have you considered using the API?

Code: Select all

https://NAGSERVER/nagiosxi/api/v1/objects/servicestatus?host_name=SERVERNAME&apikey=APIKEY&pretty=1
That should get you a JSON of all services running for that host


You could also consider using Thruk - https://www.thruk.org/

Its a great front end for user friendly viewing of configs-
Thrukconfigviewer.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Configuration Report for Host/Services

Post by lmiltchev »

Thanks @optionstechnology!

@MikeMAN987, yes you coud use the REST API in Nagios XI. You could also use the JSON Query Generator in Nagios Core.

Example URL:
[codehttp://<server ip>/nagios/jsonquery.html[/code]
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked