Page 1 of 1

Using Nagios Core for development

Posted: Thu Jun 30, 2016 9:46 am
by billy.pc
Hey there, I'm new to Nagios and I've been assigned the task to develop a software that probes a network and stores it into a database. I know that nagios itself is a monitoring tool and you can build custom plugins to send info back to nagios, but can you have that data sent elsewhere? I guess what i'm trying to say is, I'm looking for something that can help me do the probing or trapping and fetch me the data I need so that I push it to a database. Can I do that with Nagios Core or am I completely in the wrong ballpark with this? From my understanding (and i'm probably understanding it wrong), nagios allows to do so, but all the data is stored again on nagios ui? I know little to nothing about the network side of things, so unfortunately this is brand new territory for me. Any help and feedback is greatly appreciated. I'm unsure of this is the right place to be posting it as well. Thank you in advance!

Re: Using Nagios Core for development

Posted: Thu Jun 30, 2016 9:57 am
by mcapra
I suppose this is something that could be done with Nagios Core if you really wanted to, but Core was designed to monitor known hosts/services. There isn't an "automated discovery" option (though there is for Nagios XI). Is there anything stopping you from using a tool like nmap (https://nmap.org/), writing a script to check an entire range of IPs, and parsing the output?

Nagios XI includes an "automated discovery" tool that would achieve roughly what you are looking for:
https://exchange.nagios.org/directory/A ... rd/details

But all the aforementioned wizard does is exactly the process I described: runs nmap, checks the output, parses it.

Re: Using Nagios Core for development

Posted: Thu Jun 30, 2016 10:11 am
by billy.pc
mcapra wrote:I suppose this is something that could be done with Nagios Core if you really wanted to, but Core was designed to monitor known hosts/services. There isn't an "automated discovery" option (though there is for Nagios XI). Is there anything stopping you from using a tool like nmap (https://nmap.org/), writing a script to check an entire range of IPs, and parsing the output?

Nagios XI includes an "automated discovery" tool that would achieve roughly what you are looking for:
https://exchange.nagios.org/directory/A ... rd/details

But all the aforementioned wizard does is exactly the process I described: runs nmap, checks the output, parses it.
ah ok. In the end I will need some sort of probing server that can be constantly feeding info back to the database that then sends it to my own custom application. I will look into Nmap some more and see what that does. Auto Discovery may not be something that is needed for my use upon further discussion with my colleague. My main concern is finding a server or something that can constantly monitor a host, or a network, and then feed me data that i need.

Re: Using Nagios Core for development

Posted: Thu Jun 30, 2016 10:31 am
by mcapra
billy.pc wrote:My main concern is finding a server or something that can constantly monitor a host, or a network, and then feed me data that i need.
Ah, well that sounds exactly like what Nagios Core does! Nagios Core would then exist on it's own server and keep track of the things you tell it to keep track of. It can be configured for email alerts if a host goes down, a service (like disk usage) is experiencing issues, etc. In short, you tell Nagios the IP/hostname of the host you want to monitor, and it will let you know if that host goes down. Beyond that, you can also install an agent on the host which will feed Nagios Core information like CPU usage, disk space, temperature, etc.

Nagios Core can be a bit of a pain to set up and configure initially (which is why Nagios XI exists), but it is quite a powerful tool.

This guide provides a pretty good overview of what Nagios is/does:
http://users.telenet.be/mydotcom/howto/ ... index.html

Otherwise, the forums are a pretty good place if you have more involved questions :)

Re: Using Nagios Core for development

Posted: Thu Jun 30, 2016 10:40 am
by billy.pc
mcapra wrote:
billy.pc wrote:My main concern is finding a server or something that can constantly monitor a host, or a network, and then feed me data that i need.
Ah, well that sounds exactly like what Nagios Core does! Nagios Core would then exist on it's own server and keep track of the things you tell it to keep track of. It can be configured for email alerts if a host goes down, a service (like disk usage) is experiencing issues, etc. In short, you tell it the IP of the host you want to monitor, and it will let you know if that host goes down. Beyond that, you can also install an agent on the host which will feed Nagios Core information like CPU usage, disk space, temperature, etc.

Nagios Core can be a bit of a pain to set up and configure initially (which is why Nagios XI exists), but it is quite a powerful tool.

This guide provides a pretty good overview of what Nagios is/does:
http://users.telenet.be/mydotcom/howto/ ... index.html

Otherwise, the forums are a pretty good place if you have more involved questions :)
Thanks mcapra! Would I be able to retrieve the data that I have stored into nagios in some way? I've got it set up and running locally on my computer for test purposes. I will look into the guides some more to learn more about it

Re: Using Nagios Core for development

Posted: Thu Jun 30, 2016 10:47 am
by mcapra
That depends on what sort of data you are looking to retrieve.

If you want to pull historical performance data for a given host, there's ways to do that. Here's a document that gives a brief rundown on how performance data is handled.
https://assets.nagios.com/downloads/nag ... fdata.html

Within the service_perfdata_file_template definition, you could format the data to be in the form of a csv, SQL query, whatever you like.

PNP4Nagios is a pretty popular add-on for graphing/storing performance data:
https://exchange.nagios.org/directory/A ... os/details

If you're looking to do reporting there's a few different options available on the Nagios Exchange which is basically our community hub for plugins, mods, add-ons, that sort of thing:
https://exchange.nagios.org/