Installing Nagios & Nagvis on Centos 6.2 (Part I)

Nagios is an open source computer system monitor, network monitoring and infrastructure monitoring software application. Nagios offers monitoring and alerting for servers, switches, applications, and services. It watches hosts and services. It alerts users when things go wrong and alerts them again when those wrong things get better/resolved.

Installing RPMforge repository
Download the rpmforge-release package

For Centos 32-bits

# wget

For Centos 64-bits

# wget

Install DAG’s GPG key

# rpm –import

Verify the package you have downloaded

# rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm

Install the package

# rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm

Set SELINUX=disabled on “/etc/selinux/config” file

# nano “/etc/selinux/config”
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
# targeted – Targeted processes are protected,
# mls – Multi Level Security protection.

and reboot system

# reboot

Install Nagios

# yum -y install nagios nagios-plugins nagios-plugins-nrpe

Set Apache and Nagios services to start on boot

# chkconfig httpd on
# chkconfig nagios on

Start Apache and Nagios services

# service httpd start
# service nagios start

We need also to open  port 80 from the firewall

# iptables -I INPUT -p tcp -m tcp –dport 80 -j ACCEPT

and save the changes

# service iptables save

Create user nagios to access

# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

Now we can access to Nagios:   http://Your_Server_Nagios_IP:/nagios