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
Configuration Report for Host/Services
-
jforcier
Re: Configuration Report for Host/Services
Try accessing Nagios Core by using this link, where xxx.xxx.xxx.xxx if the IP of the XI server:
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?
Code: Select all
http://xxx.xxx.xxx.xxx/nagios/-
MikeMAN987
- Posts: 58
- Joined: Fri Sep 29, 2017 9:57 am
Re: Configuration Report for Host/Services
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
have you considered using the API?
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-
Code: Select all
https://NAGSERVER/nagiosxi/api/v1/objects/servicestatus?host_name=SERVERNAME&apikey=APIKEY&pretty=1You could also consider using Thruk - https://www.thruk.org/
Its a great front end for user friendly viewing of configs-
You do not have the required permissions to view the files attached to this post.
Re: Configuration Report for Host/Services
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]
@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!