Nagios Webservices

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Nagios Webservices

Post by lafargeuser »

What are the webservices exposed by Nagios ?

I need to know this for integration purpose.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Webservices

Post by abrist »

Could you clarify your request?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Nagios Webservices

Post by lafargeuser »

Here, I am trying to integrate Nagios with 3rd party tool using Webservice.

If I'm correct, Nagios use Apache(HTTPD) web services.

If yes, do I need to add that application IP & PORT no in httpd.conf file & how do I do that, I mean what exact changes I have to do ?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Webservices

Post by abrist »

lafargeuser wrote:If I'm correct, Nagios use Apache(HTTPD) web services.
Yes, XI uses apache.
lafargeuser wrote:If yes, do I need to add that application IP & PORT no in httpd.conf file & how do I do that, I mean what exact changes I have to do ?
This is a very vague question, and it all depends on what you are trying to accomplish.
What type of integration are you looking for?
Are you trying to run your third party application on the same web server as Nagios XI?
Or are you trying to allow access to or from the XI pages and your third party service?
Or something else?

There are many different levels of "integration". Could you be *specific*?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Nagios Webservices

Post by lafargeuser »

I am creating tool, which will be on a diffent server. Now my tool should call webservice of Nagios and pull all the alerts in our code.
Let us know, if this is possible and how ?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios Webservices

Post by sreinhardt »

Well sure it's possible, but it is definitely not the intended use of nagios. You could do it in a number of different ways, from querying the database, scraping the web page, using XI to forward results to the other machine. So yes it's definitely possible, but I am left wondering why you would need to do this, as being an easy to use web interface for nagios is one of the main advantages of XI.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Webservices

Post by abrist »

It is possible. You could make the appropriate requests the to core cgis, or you could make use of the XI backend api to receive status XML.

Core CGIs:
http://nagios.sourceforge.net/docs/3_0/cgis.html
http://stackoverflow.com/questions/7768 ... eb-service
OR - just query the cgis directly

XI Backend:
http://assets.nagios.com/downloads/nagi ... nd_API.pdf
http://exchange.nagios.org/directory/Do ... de/details
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Nagios Webservices

Post by lafargeuser »

Hi All,
Thanks for your replies. I'll go thur the suggested URLs and see if it satisfies my requirement.
In the meantime just wanted you guys to know what actually I want to do.
"Whenever a alert is generated in Nagios, it should send this alert to my in-house developed tool. This tool based on certain conditions & logic will execute a script to remidiate this alert."
Now I know that Nagios can itself execute script to remidiate the alert. But I am creating this in-house tool as a central repository, having detailed set of rules which will decide what action is to be taken & based on that I will be executing a particular script.
Also, my in-house tool & Nagios will always be on 2 different VMs.

Hence for this I need a way (web services, XML passing, database query etc.) to get all Nagios alerts in my code.
Hope I was able to explain this & need your help in the finding the best possible integration technique.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Webservices

Post by slansing »

How were you thinking of sending this alert? How is this tool going to read alerts in from your programs? Have you considered using an event handler to trigger one of a few scripts you create on the nagios server which will then be able to more flexibly send an alert in a way the tool understands?:

http://nagios.sourceforge.net/docs/3_0/ ... dlers.html
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: Nagios Webservices

Post by lafargeuser »

Is there any Webservice available in Nagios. By calling I can send Nagios live alerts to my 3rd party tool.
Locked