Is it possible to use the new REST API of Nagios XI to export the historical performance data for more then 1 host at a time?
I see that the GET objects/rrdexport option provides the historical performance data but only for a single host. Is there an option to get the data for multiple hosts at the same time?
REST API: How to query performance data for multiple hosts?
Re: REST API: How to query performance data for multiple hos
It looks like you can only supply one host name in the API command line call to you cannot do multiple hosts at one time.
When I added more host names to the call, it only returned data on the first one in the list.
When I added more host names to the call, it only returned data on the first one in the list.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: REST API: How to query performance data for multiple hos
Hi, thanks for the reply!
And is there any suggestion on how to collect the performance data for all hosts?
I am considering the option for developing a plugin which will expose the data through HTTP requests...
And is there any suggestion on how to collect the performance data for all hosts?
I am considering the option for developing a plugin which will expose the data through HTTP requests...
Re: REST API: How to query performance data for multiple hos
And are there any recommendations on how I should collect performance data from Nagios?
The goal that I have is to collect the performances data for all the hosts and services configured on the Nagios instance on every 5 minutes for example.
I started to investigate the option to develop a plugin which will collect the data maybe through NEB and make it available for quering or directly send it somewhere...
The goal that I have is to collect the performances data for all the hosts and services configured on the Nagios instance on every 5 minutes for example.
I started to investigate the option to develop a plugin which will collect the data maybe through NEB and make it available for quering or directly send it somewhere...
Re: REST API: How to query performance data for multiple hos
I don't have any recommendations on gathering the data you are looking for but you can search the Exchange site to see if there is something that is already been published.
https://exchange.nagios.org/
Be very careful when polling the server every 5 minutes with the API, especially if there are a lot of host and service checks, it could overload the system so start small and work your way up.
https://exchange.nagios.org/
Be very careful when polling the server every 5 minutes with the API, especially if there are a lot of host and service checks, it could overload the system so start small and work your way up.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
SteveBeauchemin
- Posts: 524
- Joined: Mon Oct 14, 2013 7:19 pm
Re: REST API: How to query performance data for multiple hos
I use a direct DB query to get this information. We run this every 5 minutes and the result is absorbed by our log server.
Not an API call, but still, can be accessed remotely same as an API call. See if this syntax works for you.Just a suggestion...
Thanks
Steve B
Not an API call, but still, can be accessed remotely same as an API call. See if this syntax works for you.
Code: Select all
SELECT
`nagios_hosts`.`display_name` AS Hostname,
`nagios_services`.`display_name` AS Servicename,
`nagios_servicestatus`.`status_update_time`,
`nagios_servicestatus`.`output`,
`nagios_servicestatus`.`long_output`,
`nagios_servicestatus`.`perfdata`
FROM
`nagios_hosts`,
`nagios_services`
LEFT JOIN nagios_servicestatus ON
`nagios_services`.`service_object_id` = `nagios_servicestatus`.`service_object_id`
WHERE
`nagios_hosts`.`host_object_id` = `nagios_services`.`host_object_id`
ORDER BY
`nagios_servicestatus`.`status_update_time`
Thanks
Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
Re: REST API: How to query performance data for multiple hos
Thanks @SteveBeauchemin.
Be sure to check out our Knowledgebase for helpful articles and solutions!