Extending Nagios Core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sagarshah1983
Posts: 6
Joined: Tue Sep 17, 2013 1:13 am

Extending Nagios Core

Post by sagarshah1983 »

Hello everyone,
I am very new to Nagios core and am planning to implement this tool on Linux box for monitoring of few of the services. I have just referred to Fedora Quick Start guide for installation.
I am using free version of Nagios Core.

What I want to know is
- Are there any integration API available in Nagios, so that I can pull data and show the same in my custom web application (using REST or CLI, etc)
- Where does Nagios core keep all data of monitored services, status, etc. Does it have support for any custom database like postgres?
- Can monitored services push any custom data to Nagios at some intervals (Of course, with some extensions and enhancement to Nagios Core)?
- What all scripting languages are supported for configuration or extensions on Nagios core.

If you could help me with this basic stuff or any articles throwing light on these points, it would be really helpful.

Appreciate.

Regards,
Sagar Shah
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Extending Nagios Core

Post by slansing »

- Are there any integration API available in Nagios, so that I can pull data and show the same in my custom web application (using REST or CLI, etc)
Yes, however there is very limited documentation on the Nagios API, a co-worker is going to be working on a document designed to help fuel custom development by users by showing them some neat tricks and ways of pulling data directly from the API. This is a bit easier with Nagios XI as there are already facilities to help with pulling direct information. But it is possible with Core.
- Where does Nagios core keep all data of monitored services, status, etc. Does it have support for any custom database like postgres?
You can pull a lot of this information from the status.dat file, and the nagios.log file. Are you looking for something in particular? There are modifications to core such as nagiosQL which do use a database for information storing, in the case of nagiosQL it uses Mysql to contain configuration files and lets you edit them from the web interface. These are of course features of Nagios XI as well.

- Can monitored services push any custom data to Nagios at some intervals (Of course, with some extensions and enhancement to Nagios Core)?
What are you looking to do here? An example would be great as this could be seen a couple ways.
- What all scripting languages are supported for configuration or extensions on Nagios core.
You can actually use just about any language you want. As long as it can return valid data to Nagios you can use it, see:

http://nagiosplug.sourceforge.net/devel ... lines.html
sagarshah1983
Posts: 6
Joined: Tue Sep 17, 2013 1:13 am

Re: Extending Nagios Core

Post by sagarshah1983 »

Thank you slansing for the reply.

Here's what my intention is.

I a planning to build a web application that pulls data from Nagios about services, status, etc. So I am actually planning to build a custom web application with my own design that is dependent on Nagios core for pulling data related to monitored services.

Also, if possible, I might want to execute certain commands through the web applications, that might be supported on Nagios core.

Can you suggest me a way to go about that?

Thanks again.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Extending Nagios Core

Post by abrist »

Getting information from the nagios server:

1. custom script to parse objects.cache and status.dat and then send to your app
2. scrape the cgi urls for the info

Sending commands back:

1. command pipe. learn it love it live it use it. command|logic !
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.
Locked