Friday, February 15, 2013

Installing Centreon 2.4 on CentOS 6.3 x64 - Step by Step


In this no-brainer guide I am going to detail how to install Centreon on a brand new CentOS 6.3 x64 machine.
  • CentOS 6.3 x64 (this)
  • Nagios Core 3.4.4 (this)
  • Nagios Plugins 1.4.16 (this)
  • Centreon 2.4 (this)


  • CentOS is installed in text-mode using the CentOS-6.3-x86_64-LiveCD.iso image on a VirtualBox VM in my case
  • Firewall ports 22 and 80 have been opened by the configuration tool
  • Default services have been installed + sshd
  • I consciously don't start the with yum update/upgrade so the expected result should be as much the same as possible

# install RPMForge
# for details visit this website:
rpm --import

uname -i
# for me 'x86_64' is the result so I'll choose the x86_64 version
wget -N
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm

# Installing Apache2 + PHP
yum -y install httpd php php-mysql php-gd
usermod -U apache
chkconfig httpd on
# Set your timezone in php.ini to get rid of an ugly warinng in the future.
# find date.timezone at the [date] section, uncomment and set it. for me it's Europe/Bucharest
# date.timezone = Europe/Bucharest
# find yours here:
vim /etc/php.ini
# Add port 80 to Firewall
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT 
sudo service iptables save

# Installing GD modules
yum -y install gd fontconfig-devel libjpeg-devel libpng-devel gd-devel perl-GD

# Installing MySQL
yum -y install openssl-devel perl-DBD-MySQL mysql-server mysql-devel

# Installing PHP Dependencies
yum -y install php-ldap php-xml php-mbstring

# Installing DBI modules
yum -y install perl-DBI perl-DBD-MySQL

# Installing PERL modules
yum -y install perl-Config-IniFiles

# Installing RRDTools
yum -y install rrdtool perl-rrdtool

# Installing SNMP
yum -y install perl-Crypt-DES perl-Digest-SHA1 perl-Digest-HMAC net-snmp-utils
yum -y install perl-Socket6 perl-IO-Socket-INET6 net-snmp net-snmp-libs php-snmp dmidecode lm_sensors perl-Net-SNMP net-snmp-perl

# Misc
yum -y install fping cpp gcc gcc-c++ libstdc++ glib2-devel
# Make is not included on cent-os by default
yum -y install make

yum -y install php-pear
pear channel-update 
# for those who have a web proxy
# pear config-set http_proxy 
pear upgrade-all

# add the line rocommunity public to snmpd.conf
sed -i '$ a\rocommunity public' /etc/snmp/snmpd.conf
service snmpd start
chkconfig snmpd on
# enabling NTP couldn't hurt
chkconfig ntpd on 
service ntpd start

Installing Nagios

# Creating the nagios user
/usr/sbin/useradd -m nagios
/usr/sbin/usermod -L nagios

# Creating a group to be able to use external commands
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagios,nagcmd nagios
/usr/sbin/usermod -G nagios,nagcmd apache

# Download & Compile
cd /usr/local/src/
wget -N
tar -xzf nagios-3.4.4.tar.gz
cd nagios

./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --enable-nanosleep --enable-event-broker
make all
make install
make install-init
make install-commandmode
make install-config
chkconfig nagios on
service nagios start

Compiling Nagios Plugins

cd /usr/local/src
wget -N

yum -y install fping openssl-devel openldap-devel postgresql-devel radiusclient-ng-devel samba-client libsmbclient

yum -y install perl-devel
cd /usr/local/src
wget -N
tar -xzf ExtUtils-MakeMaker-6.64.tar.gz
cd ExtUtils-MakeMaker-6.64
perl Makefile.PL
make install

cd /usr/local/src
tar -xzf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl=/usr/bin/openssl --enable-perl-modules

# Test-Simple-0.70 fails to compile otherwise so have to do it manually first
cd ./perlmods/Test-Simple-0.70
perl Makefile.PL
make install

# go back to nagios-plugins to make install
cd ../..
make install

Installing NDOutils

cd /usr/local/src
wget -N
tar -zxvf ndoutils-1.5.2.tar.gz
cd ndoutils-1.5.2

# get the patch and apply it; wget to same folder as ndoutils
wget -N
yum -y install patch
patch -p1 -N < ndoutils1.5.2_light.patch

# continue installation
./configure --prefix=/usr/local/nagios/ --enable-mysql --with-ndo2db-user=nagios --with-ndo2db-group=nagios

# After creating the binaries and libraries they have to be copied
cp -f ./src/ndomod-3x.o /usr/local/nagios/bin/ndomod.o
cp -f ./src/ndo2db-3x /usr/local/nagios/bin/ndo2db
cp -f ./config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
cp -f ./config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
sudo chmod 774 /usr/local/nagios/bin/ndo*
sudo chown nagios:nagios /usr/local/nagios/bin/ndo*

# make ndo2db daemon autorun
cp -f ./daemon-init /etc/init.d/ndo2db
chmod +x /etc/init.d/ndo2db
chkconfig ndo2db on

Click here for Part 2


  1. Have you been able to do this the pre-made packages from EPEL?

  2. I have a question in the ndoutils, Is it necessary to set up your own database?