Difference between revisions of "Nagios"

From SME Server
Jump to navigationJump to search
Line 3: Line 3:
 
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 contribs 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 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).
  
  
Line 11: Line 12:
  
  
The base packages are installed via yum from the Centos and DAG repostiories. Additionally the following packages are included in this contrib:
+
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:
  
 
{| border="1" cellpadding="3" cellspacing=0
 
{| border="1" cellpadding="3" cellspacing=0
 
! Package !! Purpose
 
! Package !! Purpose
 
|-
 
|-
| smeserver-nagios || integrates Nagios service into the SME Server
+
| smeserver-nagios RPM|| integrates Nagios service into the SME Server
 
|-
 
|-
| smeserver-nagios-nrpe || integrates NRPE service into the SME Server
+
| smeserver-nagios-nrpe RPM|| integrates NRPE service into the SME Server
 
|-
 
|-
| smeserver-nagios-nsca || integrates NSCA service into the SME Server (needed in a Distributed Installation)
+
| smeserver-nagios-nsca RPM|| integrates NSCA service into the SME Server (needed in a Distributed Installation)
 
|-
 
|-
| smeserver-nagios-backup || Nagios backup integration. Includes Nagios configuration and status data into the SME standard backup
+
| smeserver-nagios-backup RPM|| Nagios backup integration. Includes Nagios configuration and status data into the SME standard backup
 
|-
 
|-
| perl-Nagios-Plugin || a family of perl modules to streamline writing Nagios plugins
+
| perl-Nagios-Plugin RPM|| a family of perl modules to streamline writing Nagios plugins
 
|-
 
|-
| nagios-plugins-temptrax || Plugins for the Sensatronics Ethernet Temperature Devices E4/E16/F
+
| nagios-plugins-temptrax RPM|| Plugins for the Sensatronics Ethernet Temperature Devices E4/E16/F
 
|-
 
|-
| smeserver-nagios-plugins-mysql || Plugin that checks the mysqld service on a smeserver
+
| smeserver-nagios-plugins-mysql RPM|| Plugin that checks the mysqld service on a smeserver
 
|-
 
|-
| nagios-of-plugins || Additional plugins written by Gavin Carr of Open Fusion
+
| nagios-of-plugins RPM|| Additional plugins written by Gavin Carr of Open Fusion
 
|-
 
|-
| nagios-plugins-generic || A generic plugin [http://www.my-plugin.de/wiki/doku.php/projects:check_generic:start read more...]
+
| nagios-plugins-generic RPM|| A generic plugin. [http://www.my-plugin.de/wiki/doku.php/projects:check_generic:start Read more...]
 
|-
 
|-
| Mail-SendEasy-CLI<br>perl-Mail-SendEasy || Provide /usr/bin/mailsend, a more powerful replacement for the /bin/mail command
+
| 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 || Wb-based terminal. Linked into the Nagios Home menu. See [[Ajaxterm]]
+
| smeserver-ajaxterm RPM|| Web-based terminal. Linked into the Nagios Home menu. See [[Ajaxterm]]
 
|-
 
|-
 
| nagios-nuvola-1.0.3.tar.gz || Nuvola GUI theme
 
| nagios-nuvola-1.0.3.tar.gz || Nuvola GUI theme
Line 49: Line 51:
  
 
=== Installation ===
 
=== Installation ===
Unpack the tarball:<br>
+
Download and unpack the tarball on your central Nagios server and on all other SME Servers you want to monitor:<br>
 
<code>tar xzf smeserver-nagios-complete-1.0.0.tgz<br>
 
<code>tar xzf smeserver-nagios-complete-1.0.0.tgz<br>
cd smeserver-nagios-complete-1.0.0</code>
+
cd smeserver-nagios-complete-1.0.0<br></code>
 +
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.
  
=== Usage ===
 
Point your browser to https://nagios_server_ip/nagios/
 
  
 +
==== Central Nagios server installation ====
 +
<code>cd smeserver-nagios-complete-1.0.0<br>
 +
./install.sh central </code><br>
 +
Test the installation by pointing your browser to <code>https:<b></b>//nagios_central_server_ip/nagios/</code><br>
 
Basic login in as admin.
 
Basic login in as admin.
  
  
 +
==== NRPE installation on the servers to monitor ====
 +
<code>cd smeserver-nagios-complete-1.0.0<br>
 +
./install.sh nrpe</code><br>
 +
If the server is behind a firewall, you must forward port 5666/tcp to the server.<br>
 +
Test the installation by running this command on the central Nagios server:<br>
 +
<code>/usr/lib/nagios/plugins/check_nrpe -H IPADDRESS</code><br>
 +
Expected result: <code>NRPE v2.5.1</code>
 +
 +
 +
=== Configuration ===
 +
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.
 +
==== 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.
 +
* Set the following in /etc/nagios/cgi.cfg to grant full accces to the user admin:<br>
 +
<code>
 +
use_authentication=1<br>
 +
authorized_for_system_information=admin<br>
 +
authorized_for_system_commands=admin<br>
 +
authorized_for_configuration_information=admin<br>
 +
authorized_for_all_hosts=admin<br>
 +
authorized_for_all_host_commands=admin<br>
 +
authorized_for_all_services=admin<br>
 +
authorized_for_all_service_commands=admin<br>
 +
</code>
 +
* On the NRPE Server you find a /etc/nagios/nrpe.cfg with many predefined commands. Modify them to fit your needs.
 +
* 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.
  
 
=== Additional information ===
 
=== Additional information ===
 +
* 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.
 +
* 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.
  
  
 +
=== References ===
 +
perl-Nagios-Plugin: http://members.financial.com/~cmr/rpmforge/perl-Nagios-Plugin/<br>
 +
nagios-of-plugins: http://www.nagiosexchange.org/Plugin_Packages.52.0.html?&tx_netnagext_pi1%5Bp_view%5D=323<br>
 +
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>
 +
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>
 +
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"''
 
----
 
----
 
[[Category: Webapps]]
 
[[Category: Webapps]]
 
[[Category: Howto]]
 
[[Category: Howto]]
 
[[Category: Administration]]
 
[[Category: Administration]]

Revision as of 20:54, 13 November 2007

Incomplete.png Incomplete:
This article or section needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page


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


Nagios-screenshot-8.png Statusmap screenshot of a sample Nagios configuration


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:

Package Purpose
smeserver-nagios RPM integrates Nagios service into the SME Server
smeserver-nagios-nrpe RPM 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-backup RPM Nagios backup integration. Includes Nagios configuration and status data into the SME standard backup
perl-Nagios-Plugin RPM a family of perl modules to streamline writing Nagios plugins
nagios-plugins-temptrax RPM 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-of-plugins RPM Additional plugins written by Gavin Carr of Open Fusion
nagios-plugins-generic RPM A generic plugin. Read more...
Mail-SendEasy-CLI RPM
perl-Mail-SendEasy RPM
Provide /usr/bin/mailsend, a more powerful replacement for the /bin/mail command. Run mailsend --help for help.
smeserver-ajaxterm RPM Web-based terminal. Linked into the Nagios Home menu. See Ajaxterm
nagios-nuvola-1.0.3.tar.gz Nuvola GUI theme
nagios-icons-nx.tgz additional useful icons, inlucding the SME logo


Download

smeserver-nagios-complete-1.0.0.tgz

Installation

Download and unpack the tarball on your central Nagios server and on all other SME Servers you want to monitor:
tar xzf smeserver-nagios-complete-1.0.0.tgz
cd smeserver-nagios-complete-1.0.0
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.


Central Nagios server installation

cd smeserver-nagios-complete-1.0.0
./install.sh central

Test the installation by pointing your browser to https://nagios_central_server_ip/nagios/
Basic login in as admin.


NRPE installation on the servers to monitor

cd smeserver-nagios-complete-1.0.0
./install.sh nrpe

If the server is behind a firewall, you must forward port 5666/tcp to the server.
Test the installation by running this command on the central Nagios server:
/usr/lib/nagios/plugins/check_nrpe -H IPADDRESS
Expected result: NRPE v2.5.1


Configuration

It is strongly recommended to read the Nagios and NRPE documentation to understand the principles of operation before you start to configure Nagios.

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.
  • Set the following in /etc/nagios/cgi.cfg to grant full accces to the user admin:

use_authentication=1
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

  • On the NRPE Server you find a /etc/nagios/nrpe.cfg with many predefined commands. Modify them to fit your needs.
  • 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.

Additional information

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


References

perl-Nagios-Plugin: http://members.financial.com/~cmr/rpmforge/perl-Nagios-Plugin/
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/Environmental.60.0.html?&tx_netnagext_pi1%5Bp_view%5D=246&tx_netnagext_pi1%5Bpage%5D=20%3A10
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"