rilpoint_mw113

Nagios

Contents

1 Introduction

Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. Read more...

Note:
This contrib was only applied and used on fresh SME (server only mode) install. Conflicts with other installed packages were not examined. The author strongly recommend to install this monitoring system on a dedicated server. It is entirely possible to run it on a virtualized system, which monitors the host itself. In this case you should set up a second Nagios server (acting as a watchdog) on an independent hardware (physically or virtualized) to monitor the main Nagios system

This Nagios contrib installs Nagios Version 3 and was tested on fresh installed SME Server 7.4 It provides all packages needed to setup a SME Server as a central Nagios monitoring server including the graphical performance data analyser PNP4Nagios.

Image:Nagios-screenshot-8.png Image:PNP-Temperature.jpg
Statusmap screenshot of a sample Nagios configuration PNP4Nagios Screenshot

2 Installation

Note:
If you have the Nagios 2 contrib installed, follow the update instructions on this page

2.1 Installation of a central Nagios server

First make sure that the neddix yum repository is configured. Then install the packages

/usr/bin/yum --enablerepo=neddix --enablerepo=base install \
 smeserver-nagios pnp smeserver-nagios-backup \
 perl-Nagios-Plugin smeserver-nagios-plugins-mysql \
 nagios-plugins-generic nagios-of-plugins nagios-nuvola \
 nagios-plugins-temptrax nagios-plugins-esx3i \
 nagios-plugins-setuid perl-Config-Tiny 

Use the configuration files from the smeserver-nagios package as a starting point. This provides a working configuration.

/bin/cp -ba /etc/nagios/nagios.cfg-smeserver /etc/nagios/nagios.cfg
/bin/cp -ba /etc/nagios/cgi.cfg-smeserver /etc/nagios/cgi.cfg

Configuring global access with password required

config set nagios service Name Nagios PublicAccess global-pw
expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart
service nagios restart

Test the installation by pointing your browser to https://IPADDRESS/nagios/

Browser login in as admin. After 10 minutes the performance data graphes are available. Click on on the 'star' icon next to the service name to view the graphes on a new page.

2.1.1 Install the Nuvola theme (optional)

The Nuvola theme provides a nice and modern GUI. The screenshot above was made with the Nuvola theme installed.

cd /usr/share/nagios
rm -rf config.js images index.html main.html side side.html stylesheets
cd -
tar --strip-path=1 -C /usr/share/nagios -xzf /usr/lib/nagios/tarballs/nagios-nuvola-*.tar.gz
chmod a+r -R /usr/share/nagios

Empty your browser cache and reload the Nagios page.

2.1.2 Integrate Ajaxterm in the Nuvola theme Home menu (optional)

Install the Ajaxterm contrib and run

patch -p0 /usr/share/nagios/side/dtree_data.js < /usr/lib/nagios/tarballs/dtree_data.js.patch

Empty your browser cache and reload the Nagios page.

2.1.3 Install additional logo icons (optional)

This installs a set of icons, including the SME server logo. The logos can be used in the hostextinfo{} sections. A preview of the logos can be found here.

tar --strip-path 1 -C /usr/share/nagios/images/logos -xzf /usr/lib/nagios/tarballs/nagios-icons-nx-*.tar.gz
chown nagios.root  /usr/share/nagios/images/logos/*
chmod 644  /usr/share/nagios/images/logos/*

2.2 Hints

  • Place all your configuration files in /etc/nagios/ in the sub-directories templates, host, services, etc.
  • Do not change the default pathes of log files, rrd files, etc.. The smeserver-nagios-backup RPM requires these settings to work properly.
  • Nagios 3 runs host checks that provides performance data. Add this action_url option to each host definiton:
action_url /nagios/pnp/index.php?host=$HOSTNAME$
  • Add this action_url option to service checks with performance data output
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
  • You can permit other users to access Nagios. Add them separated by a comma to the lines
authorized_for_system_information=admin
authorized_for_system_commands=admin
authorized_for_configuration_information=admin
authorized_for_all_hosts=admin
authorized_for_all_host_commands=admin
authorized_for_all_services=admin
authorized_for_all_service_commands=admin
  • It is a good idea to make your Nagios server as independent as possible from the infrastructure it monitors, i.e., use a dedicated hardware, network, mail- and pager system, firewall and internet connection if possible.
  • Consider to setup a second Nagios somewhere on your network, which monitors your central Nagios server. Then you need to install the NRPE also on the central server.


2.3 Backup and Restore

With the smeserver-nagios-backup RPM installed all Nagios and PNP configuration data, status data and archives are included in the SME Server standard backup. In the pre-backup event those data are copied to the /home/e-smith/db/nagios/ directory. As the nagios service is stopped during copying it is recommended to configure Nagios to save its scheduling info (next check time) for hosts and services in a file and use this at startup. Otherwise Nagios would re-schedule all checks spreaded over the timeframe defined by max_service_check_spread and max_host_check_spread (default 30 min). As a result you would have gaps in checking and visible gaps in the PNP graphes.

in /etc/nagios/nagios.cfg set:

retain_state_information=1
state_retention_file=/var/nagios/retention.dat
use_retained_program_state=1
use_retained_scheduling_info=1

When doing a restore, the data from /home/e-smith/db/nagios/ are copied back to their original locations in the bootstrap-console-save event.

3 Uninstall

This removes the installed Nagios packages.

service nagios stop
rpm -e \
nagios-of-plugins \
nagios-plugins-esx3i \
nagios-plugins-generic \
nagios-plugins-temptrax \
perl-Nagios-Plugin \
pnp \
smeserver-nagios \
smeserver-nagios-backup \
smeserver-nagios-nrpe \
smeserver-nagios-nsca \
smeserver-nagios-plugins-mysql \
nagios-plugins-setuid \
perl-Config-Tiny

Remvove the dependencies if not needed by other contribs

rpm -e \
fping \
gd \
libart_lgpl \
libmcrypt \
nagios \
nagios-nrpe \
nagios-nsca \
nagios-nsca-client \
nagios-plugins \
nagios-plugins-nrpe \
perl-Class-Accessor \
perl-Crypt-DES \
perl-Math-Calc-Units \
perl-Net-SNMP \
perl-Params-Validate \
perl-rrdtool \
rrdtool \
xinetd 

Ignore the warnings about non-existing user nagios and group nagios.

expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart

4 References


Skin by RIL Partner
mweinber --!>