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 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm|
For Centos 64-bits
|# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm|
Install DAG’s GPG key
|# rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt|
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
|# 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