Setting up Nagios on EL6

From Alteeve Wiki
Jump to navigation Jump to search

 AN!Wiki :: How To :: Setting up Nagios on EL6

Clusters have a good, but not perfect ability to monitor their resources. For example, if a Windows-based VM crashes, it will go into an infinite loop which, to the cluster, looks like legitimate work. In a case like this, the cluster will not know that something has gone wrong.

This tutorial will introduce a dedicate Nagios VM. This VM will watch the actual services and send alerts when things go boom.

Installing Nagios

This walks through installing Nagios from source files. Please check for updated versions. The examples below show the version and file names that were most recent as of Sep. 7, 2011.

Install Prerequisites

yum install httpd php gcc glibc common gd gd-devel
chkconfig httpd on
useradd -m nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
passwd nagios

Install Nagios Core

Download and install Nagios:

cd ~
wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz
tar -xvzf nagios-3.3.1.tar.gz 
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Change your contact address.

cp /usr/local/nagios/etc/objects/contacts.cfg /usr/local/nagios/etc/objects/contacts.cfg.orig
vim /usr/local/nagios/etc/objects/contacts.cfg
diff -u /usr/local/nagios/etc/objects/contacts.cfg.orig /usr/local/nagios/etc/objects/contacts.cfg
--- /usr/local/nagios/etc/objects/contacts.cfg.orig	2011-09-07 13:17:20.000000000 -0400
+++ /usr/local/nagios/etc/objects/contacts.cfg	2011-09-07 13:17:51.000000000 -0400
@@ -32,7 +32,7 @@
 	use				generic-contact		; Inherit default values from generic-contact template (defined above)
         alias                           Nagios Admin		; Full name of user
 
-        email                           nagios@localhost	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
+        email                           digimer@alteeve.com	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
         }

Setup apache's .htpasswd:

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: 
Re-type new password: 
Adding password for user nagiosadmin
/etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for nagios3.iplink.net
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]

Install Nagios Plugins

Download and install Nagios Plugings:

cd ~
wget -c http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
tar -xvzf nagios-plugins-1.4.15.tar.gz 
cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chkconfig --add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start

Open a browser and go to http://<hostname>/nagios. Enter the username nagiosadmin and the password you set earlier.

Configuring Nagios

MS Windows

Client Downloads found here.

Thanks

  • Much of the configuration came from Unixmen.

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.