Sie sind auf Seite 1von 3

The Industry Standard in IT Infrastructure Monitoring

Purpose
This document describes how install Nagios Core and Nagios Plugins from source on CentOS and Ubuntu servers.
Target Audience
This document is intended for use by anyone wishing to install Nagios Core from source.
Prerequisites
For Ubuntu users, run all stes from this document with root ermissions. The following command can be run to switch to a root shell.
sudo -i
Pac!age re"uirements may vary deending on what tye of installation latform Nagios is being installed on.
For RHEL/ent!S users#
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
For Ubuntu users#
sudo apt-get install wget build-essential apache2 php5-gd libgd2-xpm libgd2-xpm-dev libapache2-mod-
php5
"o#n$oad %agios ore and %agios P$ugins Tarba$$s
For all systems, run the following commands in your terminal#
cd /tmp
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4..4.tar.g!
wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz
This will download Nagios Core, and it$s re"uired lugins.
Adding the %agios User and &roup
Ne%t add the aroriate user and grou for the Nagios rocess to run#
useradd nagios
groupadd nagcmd
usermod -a -" nagcmd nagios
%agios ore Insta$$ation
Page '
Coyright & '()(*'()) Nagios +nterrises, ,,C
-evision ).( . /ay, '()0
%agios ( Insta$$ing %agios ore )ro* Source
%agios Enterprises+ LL US, '-...-%A&I!S-' /eb, ###0nagios0co*
P0!0 1o2 .'34
Saint Pau$+ M% 33'5.
USA
Int6$, 7' 83'-954-:'59 E*ai$, sa$es;nagios0co*
)a2, 7' 83'-954-:'5<
tar !xvf nagios-4..4.tar.g!
tar !xvf nagios-plugins-2..tar.g!
Change to the new Nagios directory and install the ac!ages#
cd nagios-4..4
For RHEL/ent!S users#
./configure --with-command-group#nagcmd
For Ubuntu users#
./configure --with-nagios-group#nagios --with-command-group#nagcmd -$with-mail#/usr/bin/sendmail
A$$ syste*s,
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -% contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -% nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
For RHEL/ent!S users#
/etc/init.d/httpd start
reate a "efau$t User for /eb Access0
1dd a default user for 2eb 3nterface 1ccess#
htpasswd $c /usr/local/nagios/etc/htpasswd.users nagiosadmin
%agios P$ugin Insta$$ation

cd /tmp/nagios-plugins-2.
./configure --with-nagios-user#nagios --with-nagios-group#nagios
make
make install
Page 9
Coyright & '()(*'()) Nagios +nterrises, ,,C
-evision ).( . /ay, '()0
%agios ( Insta$$ing %agios ore )ro* Source
%agios Enterprises+ LL US, '-...-%A&I!S-' /eb, ###0nagios0co*
P0!0 1o2 .'34
Saint Pau$+ M% 33'5.
USA
Int6$, 7' 83'-954-:'59 E*ai$, sa$es;nagios0co*
)a2, 7' 83'-954-:'5<
%agios Ser=ice Setup
The following commands will register the Nagios daemon to be run uon system startu.
chkconfig --add nagios
chkconfig --level &5 nagios on
chkconfig --add httpd
chkconfig --level &5 httpd on
For Ubuntu#
ln -s /etc/init.d/nagios /etc/rc'.d/'((nagios
%agios /eb Interface
1fter correctly following the rocedures you should now
be able to access your Nagios Core installation from a
web browser.
Simly use the following#
http://)your.nagios.server.ip*/nagios
1nd log in with the credentials you chose when adding
the nagiosadmin user to the htasswd.users file.
)inishing Thoughts
3f you have further "uestions lease visit our suort forum at#
htt#44suort.nagios.com4forum4
Nagios Core 5ocumentation#
htt#44library.nagios.com4library4roducts4nagioscore4manuals4
Page <
Coyright & '()(*'()) Nagios +nterrises, ,,C
-evision ).( . /ay, '()0
%agios ( Insta$$ing %agios ore )ro* Source
%agios Enterprises+ LL US, '-...-%A&I!S-' /eb, ###0nagios0co*
P0!0 1o2 .'34
Saint Pau$+ M% 33'5.
USA
Int6$, 7' 83'-954-:'59 E*ai$, sa$es;nagios0co*
)a2, 7' 83'-954-:'5<