Apr 112010

In previous post we prepared our system for Nagios and Centreon installation. Let’s install Nagios

User install

PS: use “nagaccess03” as password for nagios account (see the previous post for the complete list of accounts and passwords)

sudo useradd -m -s /bin/bash nagios
sudo passwd nagios
sudo groupadd nagcmd
sudo usermod -G nagios,nagcmd nagios
sudo usermod -a -G nagios,nagcmd www-data

Nagios Core

cd /usr/local/src
sudo wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.1.tar.gz
sudo tar xvzf nagios-3.2.1.tar.gz
cd nagios-3.2.1
sudo ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=nagcmd --enable-nanosleep --enable-event-broker
sudo make all
sudo make install
sudo make install-init
sudo make install-commandmode
sudo make install-config
sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
cd ..

Nagios plugins 1.4.14

sudo wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
sudo tar xvfz nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14
sudo ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
sudo make
sudo make install
cd /usr/local/src

Ndoutils 1.4b9

sudo wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz
sudo tar xvfz ndoutils-1.4b9.tar.gz
cd ndoutils-1.4b9
sudo ./configure --prefix=/usr/local/nagios/ --enable-mysql --disable-pgsql --with-ndo2db-user=nagios --with-ndo2db-group=nagios
sudo make
sudo cp ./config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
sudo cp ./config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg

It apears that with large monitoring system, ndoutils use a lot of IO and slows down drasticly the system. It’s better to installe the patched version.

cd /usr/local/src
sudo wget -r -k -np http://svn.centreon.com/trunk/Patch-NDOutils/
cd svn.centreon.com/trunk/Patch-NDOutils
sudo bash ./configure --prefix=/usr/local/nagios/ --enable-mysql --disable-pgsql --with-ndo2db-user=nagios --with-ndo2db-group=nagios
sudo make
sudo cp src/ndomod-3x.o /usr/local/nagios/bin/ndomod.o
sudo cp src/ndo2db-3x /usr/local/nagios/bin/ndo2db
sudo chmod 775 /usr/local/nagios/bin/ndo2db
sudo chmod 755 /usr/local/nagios/bin/ndomod.o
sudo chown nagios:nagios /usr/local/nagios/bin/ndo2db
sudo chown nagios:nagios /usr/local/nagios/bin/ndomod.o

Nagios web interface

I also recommend installing Nagios web interface as it could help you comparing your centreon checks and nagios exported configuration.

Use “nagwebaccess03” as password

cd /usr/local/src/nagios-3.2.1
sudo make install-webconf
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin