Monitoring a gCube infrastructure With Nagios

From Gcube Wiki
Revision as of 14:45, 4 June 2012 by Andrea.manzi (Talk | contribs) (Configuring RRD)

Jump to: navigation, search

Overview

Nagios [1] is a popular open source computer monitor, network monitoring and infrastructure monitoring software application. Nagios offers complete monitoring and alerting for servers, switches, applications, and services and is considered the defacto industry standard in IT infrastructure monitoring.

Nagios components

Nagios is composed by 2 main components the Nagios Server and Nagios plugins

Nagios Server

A Nagios server is an application running tests distributed on the infrastructures, it offers a powerful web interface which can be used by administrator to visualize / configure tests executions.

The installation instruction for Ubuntu,Fedora and OpenSuse can be found at [2]

Nagios Plugins

Nagios plugins are applications that can be executed by the Nagios server or directly in the monitored host. in the case of plugins executed on monitored host the Nagios Server can exploit several methods in order to retrieve the monitoring test results, this capability is available trough 3 different Nagios Addons:

  • NRPE [3] which allows remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.)
  • NRDP [4] is a flexible data transport mechanism and processor for Nagios. It is designed with a simple and powerful architecture that allows for it to be easily extended and customized to fit individual users' needs. It uses standard ports protocols (HTTP(S) and XML)
  • NSCA [5] allows to integrate passive alerts and checks from remote machines and applications with Nagios. Useful for processing security alerts, as well as deploying redundant and distributed Nagios setups.


At the moment the Nagios monitoring plugins in gCube are executed directly by the Nagios server, so none of the method described before is currectly exploited. The usage of an NRPE daemon on each node of the infrastructure is currently under investigation.

PNP4Nagios

PNP is an extension for Nagios that plots the performance data provided by the probes as long as they follow the Nagios plug-in development guidelines, guidelines LCGDM probes follow.

Installation and configuration

In this document the version available in the EPEL repositories will be used (0.4). pnp4nagios already provides some documentation for version 0.4, but as it seems not to be clear enough, all steps will be detailed here.

We used to require manual installation of the pnp4nagios and php packages, but they are now a dependency of nagios-plugins-lcgdm.

Configuring RRD

In nagios.cfg, you have to set the following parameters

process_performance_data=1
enable_environment_macros=1
service_perfdata_command=process-service-perfdata

Which

  • Enables the processing of performance data
  • Enablse the passing of environment variables (only for Nagios 3.x)
  • Specifies the service used to process the performance data

process-service-perfdata is already defined under /etc/nagios/objects/commands.cfg (or similar named file), but the default definition has to be changed

define command {
  command_name    process-service-perfdata
  command_line    /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
}

Once these modifications are done, restart Nagios.

# service nagios restart

Link between Nagios and pnp4nagios

just be sure that this line

{{{ action_url /nagios/html/pnp4nagios/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$ }}}

is present in the generic-service.cfg definition. Reload Nagios and you will see a small start linking to the graph, next to each service, and in the detailed view as well.

Nagios Configuration in gCube

As said the current Nagios monitoring architecture in gCube does not require the installation of plugins on the monitored machine. The test are only executed by the Nagios server with some configuration to be addressed on the monitored service /host.

Base Configuration

GHN monitoring plugins

DB monitoring plugins