Install Nagios on CentOS

Posted on Tue 19 April 2011 in CentOS

Install CentOS 5.3 using the Server template.

After you installed the system log in as root and run update the system:

yum update

If the kernel was updated reboot the system.

Now we have to include the rpmforge repository to install Nagios 3.0.x.
If you are not familiar with installing repostiorys using yum read this.
yum install yum-priorities

Add the priority lines to your repositories.

rpm --import

download the rpm including the repository files for your architecture:




verify the rpm:

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

Now install the Nagios software:

yum install nagios nagios-plugins nagios-devel nagios-plugins-nrpe

You need to disable SELinux if you want to start nagios or you have to modify the configuration of SELinux. I will only explain the easier way to disable SELinux.


set the SELinux to warn or disabled.

Allow http traffic to you machine:


Set the nagiosadmin password:

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

The username has to be nagiosadmin otherwise you will not have accessrights.

Add Nagios to your runlevels:

chkconfig --levels 35 nagios on

Add httpd to your runlevels:

chkconfig --levels 35 httpd on

Start the two services:

service httpd start
service nagios start

Connect to your Nagios Interface: