User Tools

Site Tools


linux:nagios_setup

Nagios

Installation from RPM

Install the EPEL Repo

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

See the official EPEL Homepage for the correct RPM: Official EPEL Homepage

Install Nagios and the plugins

yum install nagios nagios-plugins-all nagios-plugins-nrpe

And you're Done!

Installation from Source

Dependencies

First install the dependencies (if not already done…)

yum install httpd php
yum install gcc glibc glibc-common
yum install gd gd-devel

User Creation

1. Create a user named nagios and give it a password

useradd -m nagios
passwd nagios

2. Create a group called nagios

groupadd nagios

3. Add the user nagios to the group nagios
IMPORTANT: Add your Apache user also to the nagios group so that
you are able use the Web Frontend!

usermod -a -G nagios nagios
usermod -a -G nagios apache

Install Process

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz
tar xzf nagios-3.2.3.tar.gz
./configure
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Then we create a nagios admin user

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

Edit your contacts.cfg and enter the mailadress of the sysadmin

vi /usr/local/nagios/etc/objects/contacts.cfg

Restart your apache:

service httpd restart

Installing the Plugins

You can get Plug ins at Nagios Exchange

This Manual shows how to install all the Basic Plug-ins.

wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
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
# add nagios as a service
chkconfig --add nagios
chkconfig nagios on

Verify the default config files:

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

Voilà! Finally start your nagios service:

service nagios start

This information is mostly taken from the officiall Nagios Guide. I recommend to read it to learn how to add hosts, users and services!

Adding Hosts

Adding Users

coming soon…

Adding Services

coming soon…

More information

skull 2011/05/17 11:12 added “more information” — skull 2012/02/15 12:00 added Install via RPM

linux/nagios_setup.txt · Last modified: 2012/02/15 12:02 by skull@darktemple.ch