Archive for the 'Tech Tips' Category

Page 2 of 4

Nagios XI 1.3 New Features For Developers

It seems almost daily that we get new feature requests for Nagios XI, and thanks to a great extensible design by Ethan Galstad, the development team here at Nagios is able to produce new features and components for Nagios XI on a fairly regular basis. However, as the popularity of Nagios XI continues to grow, so does the need for custom features, modifications, and tools for our customers to use. We’ve added several new features and developer hooks into this most recent version of Nagios XI that we wanted to highlight for users who are interested in creating their own custom feature.

#1. Custom login splash. Several of our resellers have requested the ability to customize the login splash page when users log in to direct their end users to their own support channels and services. We’ve add the ability to allow users to specify their own PHP include for that splash by using the Custom Login Component. A template splash file has been added to the Nagios XI directory tree, and will be preserved through upgrades if users want to modify it. This file is located at /usr/local/nagiosxi/html/

#2. Custom status column. We’ve added some new callback functions with this release of Nagios XI, one of which is a callback that allows users to add a new table column to the host or service status tables in Nagios XI. A developer example that adds the host notes field to the status tables can be downloaded from the following link. Custom Column Component.

#3. Custom table icons. Thanks to active community member jsmurphy for this one. We’ve added a new callback function in Nagios XI where custom table icons can be inserted the status tables to act as links, or to perform special actions. This feature is demonstrated in the latest version of the Graph Explorer component, where it inserts a graph icon that can be clicked to show a performance graph pop up for the selected host or service right from the status table.


The bottom line is, we love feature ideas! We base our development priorities largely on what users are requesting from us, so if there’s a feature you want to see in Nagios XI, by all means post a request to or discuss an idea with our tech team at our Nagios Ideas forum.


Building a Nagios 4 / Nagios XI Prototype Box

So after an awesome set of presentations at the Nagios World Conference 2012, one of the hot topics for discussion was clearly the upcoming Nagios Core 4 release. Andreas Ericsson has been hard at work overhauling the Core engine to optimize performance and reduce Disk and CPU usage for Nagios, and initial tests are showing his work has paid off in a substantial way. For this experiment, we’re going to use a system with the following specs:

  • Virtual Machine running under Vmware Workstation 8
  • 2GB of RAM
  • 1 CPU, 4 Cores
  • 80GB Hard Disk
  • Nagios XI Installed
  • Nagios binaries replace with Nagios 4 monitoring engine
  • ndoutils binaries replaced with with the latest SVN code for ndoutils: nagios/ndoutils/branches/ndoutils-2-0
  • No initial performance tweaks other than Nagios 4 and ndoutils 2

I’ll post setup instructions below for users who also want to play around with this setup. Note: This setup is not intended for production installs, use this in test environments only!

Start with Nagios XI installed, either through the pre-installed VM or with a manual installation. I chose a manual installation for this demo so I could set up the hardware to my liking and give it sufficient hard drive space to test a LOT of hosts. My first attempt at the prototype only had 10GB on the box, and filled up quite quickly because of performance data. .I ran the following commands after initial Nagios XI installation and setup was completed.

From the command-line:

You can verify the upgrade succeeded by reviewing the /usr/local/nagios/var/nagios.log file. There should be some new warnings about obsolete definitions like “failure_prediction_enabled”, which we won’t worry about for now. For now I’d like to see what kind of performance impact I can expect for a large number of checks being run on this machine, so I need to quickly create a large number of checks.  I’ll achieve this by running a tools script that we include with every installation of Nagios XI.

I chose to use static configs instead of the CCM for this benchmark for ease of setup time, and also easy removal later on. This also creates a list of checks with 25% of the services showing up as critica, which is useful in testing a system stressed with alerts and notifications. However, I’m also going to turn off notifications and event handlers during this setup phase just to make sure I don’t bottleneck somewhere and tank the entire box. Now lets restart Nagios to start using the new configs.

After adding 1000 hosts and 4000 services all at a 5mn interval the CPU load is running at a nominal level, averaging anywhere from .30 – .70, which is pretty impressive for a 4 core system! There is still some Disk IO because performance data processing is happening for each service, and this will likely be one of the noticeable bottlenecks as we add more checks to this system. After the system levels out and all of the checks are settled into a hard state, I turn on notifications and event handlers and begin watching the system and testing for bottlenecks. I’ll post back with some results soon! If there are any XI users out there who want to give this a shot in their test environments and post back with their results we’d love to hear what you find!




Automated Host Management In Nagios XI

This document describes how to automate adding and removing hosts and services in Nagios XI from the command line. Some administrators may have need to automate the process of adding and removing hosts and services in Nagios XI for use with cloud computing or large environments where solutions like Puppet or Chef may already be implemented. The procedures below outline how administrators can create their own automation solutions to safely add and remove hosts and services in Nagios XI while still maintaining the integrity of the monitoring environment.

Automated Host Management Documentation

Documentation: Nagios XI Component Development

Here at Nagios Enterprises we do our best to add new features and components that meet the needs of the community and our customer base.  We get new feature requests every week, but sometimes the request is something we’re not able to fulfill in time, or the customer’s need requires a more “home grown” solution to fit the needs of their environment.  For that reason, we’ve created some documentation for getting started with Nagios XI Component Development.  The document covers some basic concepts in XI component development that would be needed regardless of what the component does, and is intended for development and administrators who are already familiar with programming concepts.  This document covers the following topics:

  • Example Component Code
  • General Developer Guidelines
  • Setting Up XI For A Development Environment
  • Component Registration and Initialization
  • Using The Backend API To Get XML Data
  • Adding XI’s CSS and Javascript

This document is available on the Nagios Library.

Nagios XI Component Development