Difference between revisions of "Talk:Nagios"

From SME Server
Jump to navigationJump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Updating from 2.12 to 3.05==
 
I was able to successfully update a simple Nagios installation from 2.12 to 3.05 using the following commands:
 
<nowiki># save the existing nagios config
 
cd /etc
 
tar -cvf nagios.tar nagios/*
 
  
# remove nagios 2.12 and install nagios 3.05
 
rpm --nodeps -e nagios
 
yum --enablerepo=dag install nagios
 
 
# restore the nagios 2.12 config folder
 
cd /etc
 
mv nagios nagios.org
 
tar xvf nagios.tar
 
 
# comment out the only nagios 2.12 directive that nagios 3.05 complained about
 
cd /etc/nagios
 
mv nagios.cfg nagios.cfg.org
 
sed s/"check_result_buffer_slots"/"# check_result_buffer_slots"/ nagios.cfg.org > nagios.cfg
 
 
# restart nagios and nagiosgrapher
 
service nagiosgrapher restart
 
service nagios restart</nowiki>
 
 
I also needed to restore the cusomized logos I had created to /usr/share/nagios/images/logos/
 
 
[[User:Mmccarn|Mmccarn]] 23:23, 16 November 2008 (UTC)
 
 
==Problem with pre-existing group named 'nagios'==
 
The install scripts failed on my system due to a pre-existing group named 'nagios'.
 
 
During install, I got some errors about "nagios doesn't exist, using root".
 
 
I deleted the nagios group, removed and reinstalled the packages, and that worked.
 
 
[[User:Mmccarn|Mmccarn]] 21:46, 25 October 2008 (UTC)
 
 
--[[User:Stephdl|Stephdl]] ([[User talk:Stephdl|talk]]) 13:37, 26 October 2013 (MDT)
 
 
{{Languages}}
 
{{Languages}}
{{Needs review}}
+
{{WIP box| --[[User:Stephdl|Stephdl]] ([[User talk:Stephdl|talk]]) 13:59, 26 October 2013 (MDT) }}
 
{{Note box|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}}
 
{{Note box|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}}
  
Line 95: Line 58:
 
=== Installation ===
 
=== Installation ===
  
{{Note box|If you have the Nagios 2 contrib installed, follow the update instructions below}}
+
{{Note box|The Current version of nagios is 3.2 in smecontribs, there is no plan yet to update this contrib. If you have the skill and the need you should work to update this work to the newer release.}}
  
 
==== Installation of a central Nagios server ====
 
==== Installation of a central Nagios server ====
Line 101: Line 64:
  
 
  yum install --enablerepo=smecontribs smeserver-nagios nagios
 
  yum install --enablerepo=smecontribs smeserver-nagios nagios
 +
 +
then to configure :
 +
 +
/bin/cp -ba /etc/nagios/nagios.cfg-smeserver /etc/nagios/nagios.cfg
 +
/bin/cp -ba /etc/nagios/cgi.cfg-smeserver /etc/nagios/cgi.cfg
 +
 +
then (optional) :
 +
cd /tmp
 +
wget http://repo.openfusion.net/centos5-i386/nagios-of-plugins-0.13.8-1.of.el5.noarch.rpm
 +
yum localinstall nagios-of-plugins-0.13.8-1.of.el5.noarch.rpm
 +
 +
then:
 +
 +
signal-event post-upgrade; signal-event reboot
 +
 +
alternatively if necessary you can install [[Nagios_NRPE|NRPE]] or [[Nagios_NSCA|NSCA]] addons not yet in smecontribs see [[bugzilla:7644]] or [[bugzilla:7645]]
 +
yum install  --enablerepo=smecontribs smeserver-nagios-nrpe
 +
or
 +
yum install  --enablerepo=smecontribs smeserver-nagios-nsca
 +
then
 
  signal-event post-upgrade; signal-event reboot
 
  signal-event post-upgrade; signal-event reboot
 +
 +
==== Configure the dag repositoy ====
 +
 +
You need to activate the [[Dag]] reposity before installing this contrib.<br />
 +
 +
see [[dag|dag repository]] <br />
 +
  
 
===== Install the VMware ESXi Server CIM Hardware Monitoring (optional) =====
 
===== Install the VMware ESXi Server CIM Hardware Monitoring (optional) =====
Line 119: Line 109:
 
To get some configuration hints run  
 
To get some configuration hints run  
 
  rpm -qi nagios-plugins-esx3i
 
  rpm -qi nagios-plugins-esx3i
 
===== Install the Nuvola theme (optional) =====
 
{{Needs review}}
 
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 nagios-nuvola-*.tar.gz
 
chmod a+r -R /usr/share/nagios
 
Empty your browser cache and reload the Nagios page.
 
 
===== Integrate Ajaxterm in the Nuvola theme Home menu (optional) =====
 
{{Needs review}}
 
Install the [[Ajaxterm]] contrib and run
 
patch -p0 /usr/share/nagios/side/dtree_data.js < dtree_data.js.patch
 
Empty your browser cache and reload the Nagios page.
 
 
===== Install additional logo icons (optional) =====
 
{{Needs review}}
 
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 [http://wiki.contribs.org/images/d/d0/Nagios-logos.jpg here].
 
 
tar --strip-path 1 -C /usr/share/nagios/images/logos -xzf nagios-icons-nx-*.tar.gz
 
chown nagios.root  /usr/share/nagios/images/logos/*
 
chmod 644  /usr/share/nagios/images/logos/*
 
  
 
==== Hints ====
 
==== Hints ====
Line 229: Line 195:
 
* PNP4Nagios: http://www.pnp4nagios.org/pnp/start
 
* PNP4Nagios: http://www.pnp4nagios.org/pnp/start
 
----
 
----
[[Category: Contrib]]
+
<nowiki>[[Category: Contrib]]
 
[[Category: Webapps]]
 
[[Category: Webapps]]
 
[[Category: Administration:Monitoring]]
 
[[Category: Administration:Monitoring]]
 +
</nowiki>

Latest revision as of 23:10, 25 January 2014


Warning.png Work in Progress:
[[User_talk: --Stephdl (talk) 13:59, 26 October 2013 (MDT) | --Stephdl (talk) 13:59, 26 October 2013 (MDT) ]] has marked this page as a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.


Important.png 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


Maintainer

Michael Weinberger


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...


This Nagios contrib installs Nagios Version 3 and was tested on fresh installed SME Server 8.0 It provides all packages needed to setup a SME Server as a central Nagios monitoring server including the graphical performance data analyser PNP4Nagios. (Applied this how-to on a fresh SME Server 7.4, works)

Nagios-screenshot-8.png Nagios-PNP-Screenshot.gif
Statusmap screenshot of a sample Nagios configuration PNP Screenshot (Source: www.pnp4nagios.org)


These packages are provided by the contrib. All other dependend packages will be installed via yum from the Centos and DAG repostitories.

Package Version Build date Purpose
smeserver-nagios 3.2.3-3 17 Oct 2013 Integrates Nagios service into the SME Server
smeserver-nagios 2.0.0-1 17 Nov 2008 Integrates Nagios service into the SME Server
smeserver-nagios-nrpe 2.0.0-1 17 Nov 2008 Integrates NRPE service into the SME Server
smeserver-nagios-nsca 2.0.0-1 17 Nov 2008 Integrates NSCA service into the SME Server (needed in a Distributed Installation)
smeserver-nagios-plugins-mysql 2.0.0-1 18 Nov 2008 Plugin that checks the mysqld service on a SME Server
smeserver-nagios-backup 2.0.0-1 17 Nov 2008 Nagios backup integration. Includes Nagios configuration and status data into the SME standard backup
nagios-plugins-temptrax 2.0.1-1 18 Nov 2008 Plugins for the Sensatronics Ethernet Temperature Devices E4/E16/F
nagios-plugins-esx3i 1.0.3-0 16 Nov 2008 Plugins to monitor ESXi servers that support the "Common Information Model (CIM)" protocol like Dell PowerEdge 29xx. Read more...
perl-Nagios-Plugin 0.17-1 19 Oct 2007 A family of perl modules to streamline writing Nagios plugins
nagios-of-plugins 0.9.4-1 08 Jul 2007 Additional plugins written by Gavin Carr of Open Fusion
nagios-plugins-generic 1.0.0 01 Nov 2007 A generic plugin. Read more...
nagios-nuvola-1.0.3.tar.gz 1.0.3 28 Oct 2007 Nuvola GUI theme
nagios-icons-nx-1.0.0.tar.gz 1.0.0 04 Nov 2007 Additional useful icons, including the SME logo

Installation

Important.png Note:
The Current version of nagios is 3.2 in smecontribs, there is no plan yet to update this contrib. If you have the skill and the need you should work to update this work to the newer release.


Installation of a central Nagios server

All needed packages are in smecontribs

yum install --enablerepo=smecontribs smeserver-nagios nagios

then to configure :

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

then (optional) :

cd /tmp
wget http://repo.openfusion.net/centos5-i386/nagios-of-plugins-0.13.8-1.of.el5.noarch.rpm
yum localinstall nagios-of-plugins-0.13.8-1.of.el5.noarch.rpm

then:

signal-event post-upgrade; signal-event reboot

alternatively if necessary you can install NRPE or NSCA addons not yet in smecontribs see bugzilla:7644 or bugzilla:7645

yum install  --enablerepo=smecontribs smeserver-nagios-nrpe

or

yum install  --enablerepo=smecontribs smeserver-nagios-nsca

then

signal-event post-upgrade; signal-event reboot

Configure the dag repositoy

You need to activate the Dag reposity before installing this contrib.

see dag repository


Install the VMware ESXi Server CIM Hardware Monitoring (optional)
Edit-find-replace.png Not reviewed:
This howto or contrib has not been reviewed and might contain code that could harm your installation. For more information on the review process have a look at the Development Review page.


If you plan to monitor an ESx3i server with CIM compliant hardware, you can configure the ESXi plugin

 /usr/bin/yum --enable=dag install openssl-devel perl-XML-SAX

Download and install the VMware Infrastructure (VI) Perl Toolkit

Ignore this warning: The following Perl modules were found on the system but may be too old to work with VIPerl: URI XML::NamespaceSupport

It does not affect the proper function of the nagios plugins.

To get some configuration hints run

rpm -qi nagios-plugins-esx3i

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.

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.

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

References


[[Category: Contrib]] [[Category: Webapps]] [[Category: Administration:Monitoring]]