Thursday, October 15, 2020

Install Nagios on Centos 6.4

Nagios, now known as Nagios Core, is a free and open-source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. 

Step 1: Install Required Dependencies

Install Apache, PHP and some libraries like gcc, glibc, glibc-common and GD libraries and its development libraries before installing Nagios.

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

Step 2: Create Nagios User and Group

Create user named nagios and group named nagcmd.

useradd nagios

groupadd nagcmd

Next, add both the nagios user and the apache user to the nagcmd group.

usermod -G nagcmd nagios

usermod -G nagcmd apache

Step 3: Download Nagios Core 3.5.0 and Nagios Plugin 2.2.1

cd /tmp

wget https://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.5.0/nagios-3.5.0.tar.gz

wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz

Step 4: Extract Nagios Core and its Plugins

tar zxf nagios-3.5.0.tar.gz

tar zxf nagios-plugins-2.2.1.tar.gz

ls –l (check the extracted folder)

Step 5: Install and Configure Web Interface for Nagios

cd nagios/

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

make all

make install

make install-init

make install-commandmode

make install-config

make install-webconf

Set the password for the nagiosadmin.

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

Restart Apache to make the new settings take effect.

service httpd restart

Step 6: Compile and Install Nagios Plugin

cd /tmp

cd nagios-plugins-2.2.1/

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

make

make install

Step 7: Verify Nagios Configuration Files 

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

 It should be look like this.



















Step 8: Add Nagios Services to System Startup

chkconfig --add nagios

chkconfig --level 35 nagios on

chkconfig --add httpd

chkconfig --level 35 httpd on

service nagios start

Open a web browser then access the Nagios http://Your-server-IP-address/nagios.

username: nagiosadmin

password: “Your-password” 

Congratulations you have installed Nagios Core.







1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete