Nagios report with hostname and ips

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sunnynani4849
Posts: 31
Joined: Fri Jan 22, 2016 1:04 am

Nagios report with hostname and ips

Post by sunnynani4849 »

Hi Team,

We are using Nagios Xi in our environment, is there anyway to pull the report which includes the hostnames, ip address , services monitored on each hosts with there thresholds from the NAGIOS console (or) is there any way we can run the mysql query to get this reported.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios report with hostname and ips

Post by mcapra »

You could use the REST API added as of Nagios XI 5. Usage can be found in the "Help" section of your Nagios XI GUI.

Here's a sample API call to get all the defined hosts in Nagios XI (this will not work on your machine; it's an example):

Code: Select all

curl -XGET "http://192.168.67.1/nagiosxi/api/v1/objects/host?apikey=KR2LLsBuhmmFnS4dbmeURW0culVlv39vbbBVW8pet69bXdH8CUiK8DcFX7gMpohD&pretty=1"
Similarly, there is also an endpoint to get all the services (this will not work on your machine; it's an example):

Code: Select all

curl -XGET "http://192.168.67.1/nagiosxi/api/v1/objects/host?apikey=KR2LLsBuhmmFnS4dbmeURW0culVlv39vbbBVW8pet69bXdH8CUiK8DcFX7gMpohD&pretty=1"
You're sort of on your own for joining the hosts+services together though. One way to do it would be to first get a list of hosts, then get a list of all the services under that host using a limited query. Limited queries are explained in the documentation I mentioned previously.
Former Nagios employee
https://www.mcapra.com/
Locked