Installing Nagios 3.3.1 in Ubuntu 10.04/11.10 Server Edition – Part I

In this guide we will be installing nagios in ubuntu server edition 10.04 or 11.10 release.

Installation:

1. Update your ubuntu server, open a terminal and type:

 sudo apt-get update

2. Install OpenSSH

sudo apt-get install openssh-server

With OpenSSH it provides an encrypted remote administration environment for telnet and FTP applications and from a SSH client such as putty and winscp where you can administer your server from a console/terminal.

3. Set Static IP Address on the server, from the console/terminal type:

sudo nano /etc/network/interfaces

and edit the following and set dhcp to static ip address.

auto eth0
iface eth0 inet dhcp

In my case it looks like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.216.188
netmask 255.255.248.0
gateway 192.168.216.1

Installing Nagios Prerequisite:

1. Install Ubuntu Server Compiler w/c is need in nagios installation and will be using “build-essential”.

sudo apt-get install build-essential

2.Installing the GD Libraries,

To install the GD libraries type in the following command:

sudo apt-get install libgd2-xpm-dev

3.Installing Apache2 and PHP 5

To install Apache and PHP 5 type in the following command:

sudo apt-get install apache2 php5-common php5 libapache2-mod-php5

Installing Nagios Core

1. Add a new Nagios user and add them to a new nagcmd group, and www-data group:

sudo useradd -m nagios
sudo passwd nagios
sudo groupadd nagcmd
sudo groupadd Nagios
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd www-data

2. Download Nagios Core and Nagios plug-ins:

cd ~/Downloads

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz

wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz

3. Untar, configure and install Nagios

tar –zxvf nagios-3.3.1.tar.gz
cd nagios

./configure --with-command-group=nagcmd

sed -i 's:for file in includes/rss/*;:for file in includes/rss/*.*;:g' ./html/Makefile

sed -i 's:for file in includes/rss/extlib/*;:for file in includes/rss/extlib/*.*;:g' ./html/Makefile

make all

make install

make install-init

make install-config

make install-commandmode

make install-webconf

4. Create the Nagios Core administrative user:

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

5. Restart Apache2

/etc/init.d/apache2 restart

5. Installing the Nagios plugins, Un tar the Nagios plug-ins:

cd ~/Downloads
tar xzf 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

6. Make Nagios start each time the Ubuntu server starts up:

ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

7.Check that the Nagios config file has no errors, if it does then fix them up:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Which should result in the following output:

Nagios Core 3.3.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 07-25-2011
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
    Checked 8 services.
Checking hosts...
    Checked 1 hosts.
Checking host groups...
    Checked 1 host groups.
Checking service groups...
    Checked 0 service groups.
Checking contacts...
    Checked 1 contacts.
Checking contact groups...
    Checked 1 contact groups.
Checking service escalations...
    Checked 0 service escalations.
Checking service dependencies...
    Checked 0 service dependencies.
Checking host escalations...
    Checked 0 host escalations.
Checking host dependencies...
    Checked 0 host dependencies.
Checking commands...
    Checked 24 commands.
Checking time periods...
    Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

8. Start Nagios

etc/init.d/nagios start

9.When the nagios start open your favorite web browser:

http://192.168.216.188/nagios
nagios3

You must log in to post a comment.

Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
Get Adobe Flash player