Current Articles | RSS Feed
Nagios is a great application for monitoring your systems, allowing you to set alert levels and trip actions when those levels are reached. The software uses a plugin-based structure; even the most simple functions (such as check_ssh and check_disk) are plugins. This makes Nagios incredibly flexible; if there's something you want to monitor, and you can think of a way to write it, you can write a plugin, hook it into Nagios, and start running it. But even better than that: for most things you might want to monitor, someone has already done written the plugin for you.
The first place to look for the plugins you want is the official Nagios Plugins site. Its plugins come in two flavors: those that are officially maintained by the Nagios plugin developer team, and those that are distributed in the contrib directory. Plugins in the contrib directory have to be installed manually and are not affected by the build process; officially maintained plugins have a suitable basic command already defined in the commands.cfg file, so are more straightforward to set up, but they comprise a fairly limited set. In most cases, you won't actually need to download these plugins from the website (though the documentation you can find there is still useful), as they are distributed as a nagios-plugins package for your OS.
The other main source of plugins, Nagios Exchange, is where the community shares plugins. The large number of plugins here all come with install instructions, and given the Nagios structure, they are pretty straightforward to install.
If you have even a super-basic Nagios system running, you've already used a few of the built-in plugins. Here are a few more useful ones that you may not have encountered yet:
To get documentation on any of these plugins, navigate to the plugin directory and use ./check_dummy --usage to get the most commonly used options, and ./check_dummy --help for a full list of options.
./check_dummy --usage
./check_dummy --help
Perhaps the most useful plugin is Nagios-NRPE, which you can get either from Nagios Exchange or as a package for your system (e.g. nagios-nrpe-plugin, and nagios-nrpe-server for the remote client, on Debian and Ubuntu).
nagios-nrpe-plugin
nagios-nrpe-server
Nagios-NRPE lets you monitor the rest of your system via a single central Nagios install. Without this or something like it, the only information you can get about remote hosts is whether they're up or down; whereas ideally you want to be able to monitor disk space, CPU usage, mail delivery, and anything else that's important to you. The NRPE server runs on the remote machine to collate information, and the central Nagios server contacts the remote NRPE server at intervals to get the information.
You need to configure Nagios-NRPE on both the remote end and the Nagios server end. A good tip is to edit /etc/nagios/nrpe-local.cfg rather than /etc/nagios/nrpe.cfg on the remote client, as this file is not overwritten when you upgrade the package.
If you can't compile or install software on your remote machine, you can instead use the check_by_ssh official plugin to do a similar job.
If you're a Windows admin or have any Windows systems in your network, you'll probably want NSClient++, which is a lot like NRPE for Windows. It runs as a daemon on the remote (Windows) machine, and loads various plugins (built-in or external scripts), which then request data from one another. It uses the check_nrpe plugin on the central Nagios server as a transport, although you can use other transports if you prefer.
You can also try NagiosEventLog to hook Nagios into the Windows Event Log. It filters and forwards messages to Nagios via the NSCA daemon. Again, very useful if you have a mixed network.
One of the most popular graphing plugins, nagiosgraph, collates data into RRD files, then generates HTML pages with graphs from that data. You can use another tool, for example gnuplot, to graph the RRD data if you want, but nagiosgraph does the job just fine. Nagiosgraph requires Perl and RRDtool be installed already.
If you use Cacti for graphing, you may be interested in C2N, which is a wrapper for the Cacti front end to include it in Nagios. Cacti is more heavyweight than nagiosgraph; if you're not using it already it might be overkill, especially if you already have plenty of host and service definitions set up in Nagios and don't want to duplicate that work.
If you're responsible for multiple systems, you may be running more than one Nagios server. However, that doesn't mean that you have to look at multiple web pages to get an overview of your systems; instead you can use MNTOS to hook them all together. It gathers data from tactical overview pages and combines them into a single XML file. However, you will need to find a suitable XML front end (an example one is included in the download). MNTOS written in PHP, so you'll also need the PHP-XML and PHP-XSL packages.
You can find a whole raft of themes and skins for Nagios in the Themes and Skins directory if you don't like the default Nagios skin. Partiuclarly popular are Exfoliation and Vautour Style. Exfoliation is a toned-down and slightly clearer version of the standard Nagios interface (in particular, the sidebar is white-on-black instead of the default black-on-white). Vautour Style is a more thorough redesign.
If you don't care for configuring things via the command line, you can get a plugin that enables you to use a web interface instead for all your configuration needs, with NConf.
Finally, if you want something really shiny, check out the Cool Stuff directory, which has a bunch of plugins, most of which involve linking Nagios into LEDs to display output.
And remember; if you can't find what you want in an existing plugin, Nagios provides plenty of scope for you to roll your own plugins and make the software do exactly what you want it to do.
Allowed tags: <a> link, <b> bold, <i> italics