Configuring REST API to access Services in NAGIOSXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
network2016
Posts: 47
Joined: Tue Mar 08, 2016 11:35 am

Configuring REST API to access Services in NAGIOSXI

Post by network2016 »

Hi

I am looking for different REst APIs available to access/export NagiosXI data to external services [WEB,or using Curl on different machine].
I have used the Back end API component of Nagios and seen few APIs there ,but they are limited I would like to get any information from the Nagios Database using APIs or curl function externally.

So can anyone please advice me what options are available in this regards . I am looking following solutions,

1. can I create a customized API for ex, get Alarm information for 5 minutes or
2. get SNMP traps information for particular host, or any services of any host at a given time period.
3. Also,what is the location where the inbuilt APIs resides in nagios Database. [which folder or file contain that]

Please help me with this.

Thank you in advance !!!!!

Waiting for the comments and help
Last edited by network2016 on Mon Oct 10, 2016 6:51 am, edited 1 time in total.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Configure Nagios to transfer DB to another server

Post by mcapra »

Here's a document on offloading the Nagios XI database:
https://assets.nagios.com/downloads/nag ... Server.pdf

You don't really need a "second Nagios XI server" so much as an external database server. This is done pretty often with the intention of improving the performance of a Nagios XI installation.
Former Nagios employee
https://www.mcapra.com/
network2016
Posts: 47
Joined: Tue Mar 08, 2016 11:35 am

Re: Configuring REST API to access Services in NAGIOSXI

Post by network2016 »

network2016 wrote:Hi

I am looking for different REst APIs available to access/export NagiosXI data to external services [WEB,or using Curl on different machine].
I have used the Back end API component of Nagios and seen few APIs there ,but they are limited I would like to get any information from the Nagios Database using APIs or curl function externally.

So can anyone please advice me what options are available in this regards . I am looking following solutions,

1. can I create a customized API for ex, get Alarm information for 5 minutes or
2. get SNMP traps information for particular host, or any services of any host at a given time period.
3. Also,what is the location where the inbuilt APIs resides in nagios Database. [which folder or file contain that]

Please help me with this.

Thank you in advance !!!!!

Waiting for the comments and help
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Configuring REST API to access Services in NAGIOSXI

Post by tmcdonald »

Were you meaning to add more? I am not sure why you quoted yourself.
Former Nagios employee
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Configuring REST API to access Services in NAGIOSXI

Post by jacek »

@network2016 - You are looking for the new REST API I think:
To view the REST API documentation in Nagios XI go to the “Help” menu, then click on the “Introduction” menu on the left (Nagios XI API Docs tab).
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Configuring REST API to access Services in NAGIOSXI

Post by mcapra »

Thanks @slytheer!

@network2016 I would suggest reviewing the documents previously mentioned and asking any specific questions you may have after doing that.
1. can I create a customized API for ex, get Alarm information for 5 minutes or
You can use the REST API previously mentioned to do similar operations (get current alerts for example).
2. get SNMP traps information for particular host, or any services of any host at a given time period.
Assuming these are configured as services, you can use the REST API to pull specific host/service status information as well.
3. Also,what is the location where the inbuilt APIs resides in nagios Database. [which folder or file contain that]
Not sure what you mean by this? The default mysql credentials on Nagios XI machines is root:nagiosxi. You should be able to view the tables that way, but we do not recommend/support direct database modification.
Former Nagios employee
https://www.mcapra.com/
Locked