Wednesday, February 1, 2012

How to Install and Configure Nagios on Redhat/Centos.

Install and configure Nagios on Centos 5.
Note: This procedure works on centos and assume work on Redhat 5 as well.

Planning: download and install apache, nagios on the system.

A. Install RPMforge package for your distribution and architecture.
[ http://dag.wieers.com/rpm/FAQ.php#B2 ]

1.a. For x86 - 32-bit systems
# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

1.b. For x64 - 64-bit systems
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

B. Install Apache.

1. Install Apache
# yum install httpd php gcc glibc glibc-common gd gd-devel

2. Configure Apache to start on boot
# chkconfig --levels 345 httpd on

3. Configure iptables to allow Apache traffic
# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
# /etc/init.d/iptables save
# /etc/init.d/iptables restart


C. Install & Configure Nagios

1. Install Nagios and Plugins
# yum install nagios nagios-plugins nagios-plugins-setuid

2. Create the default Nagios web access user & set a password
# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

3. Verify default config files
# nagios -v /etc/nagios/nagios.cfg

4. Start Nagios
# service nagios start/restart

5. Start Apache
# service httpd start/restart

6. Verify the installation.
Login to the nagios page by going to the site http://server.domain.com/nagios with nagiosadmin and password.

Good to go ...

No comments:

Post a Comment