Difference between revisions of "Nagios"

From SME Server
Jump to navigationJump to search
 
(46 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
{{Languages}}
 +
{{Needs review}}
 +
{{Note box|msg=Suggest looking at [[Zabbix]] which works for SME9.*}}
 +
{{Note box|msg=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|msg=This contrib does not work on SME8b6 as documented here, there are a few changes needed to the repository info and also the yum commands, also a change needs to be made to the location of the nagios.pid file in order for it run successfully after installation. There is an outstanding bug [[bugzilla:5539]] which contains the necessary information.}}
 
=== Maintainer ===
 
=== Maintainer ===
 
Michael Weinberger
 
Michael Weinberger
Line 4: Line 9:
  
 
=== Introduction ===
 
=== Introduction ===
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do.   [http://www.nagios.org/about/ Read more...]
+
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. [http://www.nagios.org/about/ Read more...]
  
This contrib installs Nagios Version 2.9 and was tested on SME Releases 7.1.2, 7.1.3 and 7.2.
 
It provides all packgages needed to setup a SME Server as a central Nagios monitoring server and all packages needed to monitor SME Servers via the NRPE (Nagios Remote Plugin Executer).
 
  
 +
This [[Nagios]] contrib installs Nagios Version 3 and was tested on fresh installed SME Server 7.3
 +
It provides all packages needed to setup a SME Server as a central Nagios monitoring server including the graphical performance data analyser [http://www.pnp4nagios.org/start PNP4Nagios].
 +
(Applied this how-to on a fresh SME Server 7.4, works)
  
{|
+
{| cellpadding=10
| [[Image:Nagios-screenshot-8.png]] || Statusmap screenshot of a sample Nagios configuration
+
| [[Image:Nagios-screenshot-8.png]] || [[Image:Nagios-PNP-Screenshot.gif]] 
 +
|-
 +
| Statusmap screenshot of a sample Nagios configuration || PNP Screenshot ''(Source: www.pnp4nagios.org)''
 
|}
 
|}
  
  
The base packages and all dependencies are installed via yum from the Centos and DAG repostitories. Additionally the following packages are included in this contrib:
+
These packages are provided by the contrib. All other dependend packages will be installed via yum from the Centos and DAG repostitories.  
  
{| border="1" cellpadding="3" cellspacing=0
+
{| style='white-space:nowrap' border="1" cellpadding="3" cellspacing=0
! Package !! Purpose
+
! Package !! Version !! Build date !! Purpose
 
|-
 
|-
| smeserver-nagios RPM|| 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 RPM|| integrates NRPE 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 RPM|| integrates NSCA service into the SME Server (needed in a Distributed Installation)
+
| smeserver-nagios-nsca || 2.0.0-1 || 17 Nov 2008 || Integrates NSCA service into the SME Server (needed in a Distributed Installation)
 
|-
 
|-
| smeserver-nagios-backup RPM|| Nagios backup integration. Includes Nagios configuration and status data into the SME standard backup
+
| smeserver-nagios-plugins-mysql || 2.0.0-1 || 18 Nov 2008 || Plugin that checks the mysqld service on a SME Server
 
|-
 
|-
| perl-Nagios-Plugin RPM|| a family of perl modules to streamline writing Nagios plugins
+
| 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 RPM|| Plugins for the Sensatronics Ethernet Temperature Devices E4/E16/F
+
| nagios-plugins-temptrax || 2.0.1-1 || 18 Nov 2008 || Plugins for the Sensatronics Ethernet Temperature Devices E4/E16/F
 
|-
 
|-
| smeserver-nagios-plugins-mysql RPM|| Plugin that checks the mysqld service on a smeserver
+
| 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. [http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/ Read more...]
 
|-
 
|-
| nagios-of-plugins RPM|| Additional plugins written by Gavin Carr of Open Fusion
+
| perl-Nagios-Plugin || 0.17-1 || 19 Oct 2007 || A family of perl modules to streamline writing Nagios plugins
 
|-
 
|-
| nagios-plugins-generic RPM|| A generic plugin. [http://www.my-plugin.de/wiki/doku.php/projects:check_generic:start Read more...]
+
| nagios-of-plugins || 0.9.4-1 || 08 Jul 2007 || Additional plugins written by [http://www.openfusion.com.au/labs/nagios/ Gavin Carr of Open Fusion]
|-
 
| Mail-SendEasy-CLI RPM<br>perl-Mail-SendEasy RPM|| Provide /usr/bin/mailsend, a more powerful replacement for the /bin/mail command. Run <code>mailsend --help</code> for help.
 
 
 
 
|-
 
|-
| smeserver-ajaxterm RPM|| Web-based terminal. Linked into the Nagios Home menu. See [[Ajaxterm]]
+
| nagios-plugins-generic || 1.0.0 || 01 Nov 2007 || A generic plugin. [http://www.my-plugin.de/wiki/doku.php/projects:check_generic:start Read more...]
 
|-
 
|-
| nagios-nuvola-1.0.3.tar.gz || Nuvola GUI theme
+
| nagios-nuvola-1.0.3.tar.gz || 1.0.3 || 28 Oct 2007 || Nuvola GUI theme
 
|-  
 
|-  
| nagios-icons-nx.tgz || additional useful icons, inlucding the SME logo
+
| nagios-icons-nx-1.0.0.tar.gz  || 1.0.0 || 04 Nov 2007 || Additional useful icons, including the SME logo
 +
 
 
|}
 
|}
  
 +
=== Download ===
 +
Download the packages and files from http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Nagios3/packages/ manually or run the the script [http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Nagios3/packages/wgetall wgetall] to download all in one go.
 +
bash < wgetall
 +
 +
=== Installation ===
 +
 +
{{Note box|If you have the Nagios 2 contrib installed, follow the update instructions below}}
 +
 +
==== Configure the dag repositoy ====
 +
You need to activate the [[Dag]] reposity before installing this contrib.<br />
 +
 +
see [[dag|dag repository]] <br />
  
=== Download ===
+
==== Installation of a central Nagios server ====
[http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/nagios smeserver-nagios-complete-1.0.1.tgz]
+
Intstalling the packages
 +
/usr/bin/yum --enablerepo=dag install \
 +
  nagios-plugins-setuid \
 +
  perl-Config-Tiny
 +
 
 +
/usr/bin/yum --enablerepo=dag localinstall \
 +
  smeserver-nagios-*.noarch.rpm \
 +
  pnp-*.i386.rpm \
 +
  smeserver-nagios-backup-*.noarch.rpm \
 +
  perl-Nagios-Plugin-*.noarch.rpm \
 +
  smeserver-nagios-plugins-mysql-*.noarch.rpm \
 +
  nagios-plugins-generic-*.noarch.rpm \
 +
  nagios-of-plugins-*.noarch.rpm \
 +
  nagios-plugins-temptrax-*.el4.rf.i386.rpm \
 +
  nagios-plugins-esx3i-*.el4.noarch.rpm
 +
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 ''<nowiki>https://IPADDRESS/nagios/</nowiki>''
 +
 
 +
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.
  
 +
===== Install the VMware ESXi Server CIM Hardware Monitoring (optional) =====
 +
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 [http://www.vmware.com/support/developer/viperltoolkit/ VMware Infrastructure (VI) Perl Toolkit]
  
=== Installation ===
+
Ignore this warning:
Download and unpack the tarball on your central Nagios server and on all other SME Servers you want to monitor:<br>
+
''The following Perl modules were found on the system but may be too old to work
tar xzf smeserver-nagios-complete-1.0.1.tgz
+
with VIPerl:
cd smeserver-nagios-complete-1.0.1
+
URI
Edit install.sh and set the variable NAGIOS_CENTRAL_SERVER to the IP address of your central Nagios server. Use the local IP if you check the servers over the local network or over a VPN, otherwise use the WAN IP.
+
XML::NamespaceSupport''
  
 +
It does not affect the proper function of the nagios plugins.
  
==== Central Nagios server installation ====
+
To get some configuration hints run
  cd smeserver-nagios-complete-1.0.1
+
  rpm -qi nagios-plugins-esx3i
./install.sh central
 
Test the installation by pointing your browser to <code>https:<b></b>//nagios_central_server_ip/nagios/</code><br>
 
Basic login in as admin.
 
  
 +
===== 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 nagios-nuvola-*.tar.gz
 +
chmod a+r -R /usr/share/nagios
 +
Empty your browser cache and reload the Nagios page.
  
==== NRPE installation on the servers to monitor ====
+
===== Integrate Ajaxterm in the Nuvola theme Home menu (optional) =====
cd smeserver-nagios-complete-1.0.1
+
Install the [[Ajaxterm]] contrib and run
./install.sh nrpe
+
  patch -p0 /usr/share/nagios/side/dtree_data.js < dtree_data.js.patch
If the server is behind a firewall, you must forward port 5666/tcp to the server.<br>
+
Empty your browser cache and reload the Nagios page.
Test the installation by running this command on the central Nagios server:<br>
 
  /usr/lib/nagios/plugins/check_nrpe -H IPADDRESS
 
Expected result:
 
NRPE v2.5.1
 
  
=== Configuration ===
+
===== Install additional logo icons (optional) =====
It is strongly recommended to read the [http://www.nagios.org/docs/ Nagios and NRPE documentation] to understand the principles of operation before you start to configure Nagios.
+
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].
  
When changes to the nagios configuration were made, the service must be restarted:
+
tar --strip-path 1 -C /usr/share/nagios/images/logos -xzf nagios-icons-nx-*.tar.gz
  service nagios restart
+
  chown nagios.root  /usr/share/nagios/images/logos/*
When nrpe.cfg was changed the nrpe service must be restarted:
+
  chmod 644  /usr/share/nagios/images/logos/*
  service nrpe restart
 
  
 
==== Hints ====
 
==== Hints ====
* place all your configuration files in /etc/nagios/, the Logfile /var/log/nagios/nagios.log, the Log-Archives in /var/log/nagios/archives/ and the status file in /var/log/nagios/status.dat. These are the default settings. Leave them unchanged. The smeserver-nagios-backup RPM requires these settings to work properly.
+
* Place all your configuration files in /etc/nagios/ in the sub-directories templates, host, services, etc.
* Set the following in /etc/nagios/cgi.cfg to grant full accces to the user admin:
+
 
use_authentication=1
+
* 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_information=admin
 
  authorized_for_system_commands=admin
 
  authorized_for_system_commands=admin
Line 95: Line 149:
 
  authorized_for_all_services=admin
 
  authorized_for_all_services=admin
 
  authorized_for_all_service_commands=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.
 +
 +
==== Update from Nagios 2 to Nagios 3 ====
 +
Before installing this contrib based on Nagios 3, remove all packages of the previous Nagios 2 installation
 +
service nagios stop
 +
service nagiosgrapher stop
 +
 +
/usr/bin/yum erase \
 +
nagios-plugins-esx3i \
 +
nagios-nrpe \
 +
nagios-plugins-temptrax \
 +
nagios-plugins \
 +
nagios-of-plugins \
 +
nagios-plugins-generic \
 +
nagios  smeserver-nagios-nrpe \
 +
smeserver-nagios \
 +
smeserver-nagios-plugins-mysql \
 +
nagios-plugins-nrpe  \
 +
nagios-plugins-setuid \
 +
smeserver-nagiosgrapher \
 +
smeserver-nagios-backup
 +
Remove all NagiosGrapher rrd data. It is not possible to tranfer the existing NagiosGrapher data to PNP.
 +
rm -rf /var/lib/nagios/*
 +
Backup your Nagios configuration data
 +
cp -a /etc/nagios /etc/nagios.v2
 +
Delete Nagios configuration data
 +
rm -rf /etc/nagios
 +
Move the retention data to the new Nagios 3 loaction
 +
mkdir -p /var/nagios/
 +
mv /var/log/nagios/retention.dat /var/nagios/
 +
 +
'''Now install this contrib following the instructions in chapter 'Installation'
 +
'''
 +
service nagios stop
 +
Delete the default configuration files
 +
cd /etc/nagios
 +
rm -rf commands/default.cfg \
 +
  objects \
 +
  contacts/contacts.cfg \
 +
  hostgroups/default.cfg \
 +
  hosts/localhost.cfg \
 +
  servicegroups/default.cfg \
 +
  services/localhost.cfg \
 +
  templates/default.cfg \
 +
  timeperiods/default.cfg
 +
 +
Copy your saved configuration files to /etc/nagios. When you place them into the pre-defined directories contacts, services, hostgroups, templates, commands, hosts, servicegroups, and timeperiods you don't need to adjust nagios.cfg.
 +
 +
Review your config files and do the following
 +
* add <tt>'''use host-pnp'''</tt> to your generic host definition to add an action url for PNP  to all hosts.
 +
* for all services that output performance data add <tt>'''action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$'''</tt> to your service template definitions
 +
* move all options from <tt>'''hostextinfo'''</tt>  definition (except <tt>'''host_name'''</tt> and <tt>'''action_url'''</tt>) to <tt>'''host'''</tt> definition. Delete the <tt>'''hostextinfo'''</tt>  definition.
 +
* do the same for <tt>'''serviceextinfo'''</tt> definitons
 +
 +
When done check your config
 +
nagios -v /etc/nagios/nagios.cfg
 +
and finally start the service
 +
service nagios start
 +
 +
==== 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 <tt>/home/e-smith/db/nagios/</tt> 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 <tt>max_service_check_spread</tt> and <tt>max_host_check_spread</tt> (default 30 min). As a result you would have gaps  in checking and visible gaps in the PNP graphes.
  
* On the NRPE Server you find a /etc/nagios/nrpe.cfg with many predefined commands. Modify them to fit your needs.
+
in <tt>/etc/nagios/nagios.cfg</tt> set:
* It is a good idea to make your Nagios server as independent as possible from the infrastructure it monitors. That means use a dedicated hardware, network, firewall and internet connection if possible. Consider to setup a second Nagios somewhere inside your network, which monitors your central Nagios server.
+
retain_state_information=1
* in /usr/share/nagios/images/logos you find logo images that can be used in the hostextinfo{} sections. Click [http://wiki.contribs.org/images/d/d0/Nagios-logos.jpg here] to view the logos.
+
state_retention_file=/var/nagios/retention.dat
 +
use_retained_program_state=1
 +
use_retained_scheduling_info=1
 +
 +
When doing a restore, the data from <tt>/home/e-smith/db/nagios/</tt> are copied back to their original locations in the bootstrap-console-save event.
  
 +
=== Uninstall ===
 +
This removes the installed Nagios packages.
 +
service nagios stop
  
=== Additional information ===
+
rpm -e \
* The install.sh script installs all available packages, including a few which are not necessarily needed for running Nagios, e.g. smeserver-ajaxterm. Feel free to comment out those package names in install.sh you do not want to have installed.
+
nagios-of-plugins \
* If you plan a distributed Nagios setup, you need the NSCA packages. Remove the comments of the NSCA package names in install.sh to get them installed. The NSCA setup is not used (and will not be used) by the author and therefore untested. They may not work as expected.
+
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 ===
 
=== References ===
perl-Nagios-Plugin: http://members.financial.com/~cmr/rpmforge/perl-Nagios-Plugin/<br>
+
* Nagios NRPE Contrib: [[Nagios NRPE]]
nagios-of-plugins: http://www.nagiosexchange.org/Plugin_Packages.52.0.html?&tx_netnagext_pi1%5Bp_view%5D=323<br>
+
* Nagios NSCA Contrib: [[Nagios NSCA]]
Nuvola theme: http://www.nagiosexchange.org/Image_Packs.75.0.html?&tx_netnagext_pi1%5Bp_view%5D=252&tx_netnagext_pi1%5Bpage%5D=10%3A10<br>
+
* Nagios: http://www.nagios.org/
Temptrax Plugin: http://www.nagiosexchange.org/Environmental.60.0.html?&tx_netnagext_pi1%5Bp_view%5D=246&tx_netnagext_pi1%5Bpage%5D=20%3A10<br>
+
* perl-Nagios-Plugin: http://members.financial.com/~cmr/rpmforge/perl-Nagios-Plugin/
Nagios books: ''"Nagios : system and network monitoring / Wolfgang Barth / ISBN 1-59327-070-4"'', ''"Building a Monitoring Infrastructure with Nagios / David Josephsen / ISBN 0-13-223693-1"''
+
* nagios-of-plugins: http://www.nagiosexchange.org/Plugin_Packages.52.0.html?&tx_netnagext_pi1%5Bp_view%5D=323
 +
* Nuvola theme: http://www.nagiosexchange.org/Image_Packs.75.0.html?&tx_netnagext_pi1%5Bp_view%5D=252&tx_netnagext_pi1%5Bpage%5D=10%3A10
 +
* Temptrax Plugin: http://www.nagiosexchange.org/cgi-bin/page.cgi?g=1716.html
 +
* Nagios books: ''"Nagios : system and network monitoring / Wolfgang Barth / ISBN 1-59327-070-4"'', ''"Building a Monitoring Infrastructure with Nagios / David Josephsen / ISBN 0-13-223693-1"''
 +
* Nagios in a German Computer Magazine: http://www.heise.de/netze/artikel/81238
 +
* PNP4Nagios: http://www.pnp4nagios.org/pnp/start
 
----
 
----
[[Category: Contrib]]
+
[[Category: Deprecated_Contrib]]
 +
[[Category: Nagios]]
 
[[Category: Webapps]]
 
[[Category: Webapps]]
[[Category: Howto]]
+
[[Category: Administration:Monitoring]]
[[Category: Administration]]
 

Latest revision as of 08:51, 11 July 2022


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.


Important.png Note:
Suggest looking at Zabbix which works for SME9.*


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


Important.png Note:
This contrib does not work on SME8b6 as documented here, there are a few changes needed to the repository info and also the yum commands, also a change needs to be made to the location of the nagios.pid file in order for it run successfully after installation. There is an outstanding bug bugzilla:5539 which contains the necessary information.


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

Download

Download the packages and files from http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Nagios3/packages/ manually or run the the script wgetall to download all in one go.

bash < wgetall

Installation

Important.png Note:
If you have the Nagios 2 contrib installed, follow the update instructions below


Configure the dag repositoy

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

see dag repository

Installation of a central Nagios server

Intstalling the packages

/usr/bin/yum --enablerepo=dag install \
 nagios-plugins-setuid \
 perl-Config-Tiny
/usr/bin/yum --enablerepo=dag localinstall \
 smeserver-nagios-*.noarch.rpm \
 pnp-*.i386.rpm \
 smeserver-nagios-backup-*.noarch.rpm \
 perl-Nagios-Plugin-*.noarch.rpm \
 smeserver-nagios-plugins-mysql-*.noarch.rpm \
 nagios-plugins-generic-*.noarch.rpm \
 nagios-of-plugins-*.noarch.rpm \
 nagios-plugins-temptrax-*.el4.rf.i386.rpm \
 nagios-plugins-esx3i-*.el4.noarch.rpm

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.

Install the VMware ESXi Server CIM Hardware Monitoring (optional)

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

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)

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 nagios-icons-nx-*.tar.gz
chown nagios.root  /usr/share/nagios/images/logos/*
chmod 644  /usr/share/nagios/images/logos/*

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.

Update from Nagios 2 to Nagios 3

Before installing this contrib based on Nagios 3, remove all packages of the previous Nagios 2 installation

service nagios stop
service nagiosgrapher stop
/usr/bin/yum erase \
nagios-plugins-esx3i \
nagios-nrpe \
nagios-plugins-temptrax \
nagios-plugins \
nagios-of-plugins \
nagios-plugins-generic \
nagios  smeserver-nagios-nrpe \
smeserver-nagios \
smeserver-nagios-plugins-mysql \
nagios-plugins-nrpe  \
nagios-plugins-setuid \
smeserver-nagiosgrapher \
smeserver-nagios-backup

Remove all NagiosGrapher rrd data. It is not possible to tranfer the existing NagiosGrapher data to PNP.

rm -rf /var/lib/nagios/*

Backup your Nagios configuration data

cp -a /etc/nagios /etc/nagios.v2

Delete Nagios configuration data

rm -rf /etc/nagios 

Move the retention data to the new Nagios 3 loaction

mkdir -p /var/nagios/
mv /var/log/nagios/retention.dat /var/nagios/

Now install this contrib following the instructions in chapter 'Installation'

service nagios stop

Delete the default configuration files

cd /etc/nagios
rm -rf commands/default.cfg \
  objects \
  contacts/contacts.cfg \
  hostgroups/default.cfg \
  hosts/localhost.cfg \
  servicegroups/default.cfg \
  services/localhost.cfg \
  templates/default.cfg \
  timeperiods/default.cfg

Copy your saved configuration files to /etc/nagios. When you place them into the pre-defined directories contacts, services, hostgroups, templates, commands, hosts, servicegroups, and timeperiods you don't need to adjust nagios.cfg.

Review your config files and do the following

  • add use host-pnp to your generic host definition to add an action url for PNP to all hosts.
  • for all services that output performance data add action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$ to your service template definitions
  • move all options from hostextinfo definition (except host_name and action_url) to host definition. Delete the hostextinfo definition.
  • do the same for serviceextinfo definitons

When done check your config

nagios -v /etc/nagios/nagios.cfg

and finally start the service

service nagios start

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