How to install Nagios 4.0.4 in CentOS 5.4

Posted: May 21, 2014 in Monitoring Server

Install Nagios 4.0.4 on CentOS 5.4

Prerequisites

1. yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp

clip_image002[6]

clip_image004[6]

Download Nagios Core and Nagios Plugins Tarballs

For all systems, run the following commands in your terminal:

1. cd /tmp

clip_image006[6]

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

clip_image008[6]

3. wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz

clip_image010[6]

Adding the Nagios User and Group

Next add the appropriate user and group for the Nagios process to run:

1. useradd nagios

2. groupadd nagcmd

3. usermod -a -G nagcmd nagios

clip_image012[6]

Nagios Core Installation

1. tar zxvf nagios-4.0.4.tar.gz

clip_image014[6]

2. tar zxvf nagios-plugins-2.0.tar.gz

clip_image016[6]

Change to the new Nagios directory and install the packages:

1. cd nagios-4.0.4

clip_image018[6]

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

clip_image020[6]

clip_image022[6]

All systems:

1. make all

clip_image024[6]

clip_image026[6]

2. make install

clip_image028[6]

clip_image030[6]

3. make install-init

clip_image032[6]

clip_image034[6]

4. make install-config

clip_image036[6]

5. make install-commandmode

clip_image038[6]

clip_image040[6]

6. make install-webconf

clip_image042[6]

clip_image044[6]

7. cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/

clip_image046[6]

8. chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers

clip_image048[6]

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

clip_image050[6]

clip_image052[6]

10. /etc/init.d/httpd start

clip_image054[6]

Create a Default User for Web Access.

Add a default user for Web Interface Access:

1. htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin

clip_image056[6]

clip_image058[6]

Nagios Plugin Installation

1. cd /tmp/nagios-plugins-2.0

clip_image060[6]

2. ./configure –with-nagios-user=nagios –with-nagios-group=nagios

clip_image062[6]

3. Make

clip_image064[6]

4. make install

clip_image066[6]

Nagios Service Setup

The following commands will register the Nagios daemon to be run upon system startup.

1. chkconfig –add nagios

2. chkconfig –level 35 nagios on

3. chkconfig –add httpd

4. chkconfig –level 35 httpd on

clip_image068[6]

Access Nagios

1. Restart httpd

clip_image070[6]

2. Restart nagios

clip_image072[6]

Access nagios from web: http://<ipnagioswebgui>/nagios/

Fill with htpasswd account

clip_image074[6]

clip_image076[6]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s