Cette article décrit la procédure d’installation de Centreon 2.7.x sur centos/rhel 7. Cette installation à été réalisé sur une installation fraiche de centos 7 à partir de CentOS-7-x86_64-Minimal-1511.iso. Centreon ne distribuant pas de paquets compatibles avec centos/rhel 7, cette installation sera réalisé à partir des sources disponibles ici :

https://download.centreon.com/

Préparation

Mises à jour et dépôts additionnels

On mets à jour le système :

[root@localhost ~]# yum update

On ajoute le dépôt epel :

[root@localhost ~]# yum install epel-release

On installe le dépôt RPMforge

[root@localhost ~]# yum install wget
[root@localhost ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
[root@localhost ~]# rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
[root@localhost ~]# rm rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

Apache, PHP et MariaDB

Dans centos7 mysql à été remplacé par mariaDB. Installation de apache, php et mariaDB :

[root@localhost ~]# yum install httpd php php-mysql mariadb-server mariadb

On lance et on configure apache et mariaDB pour se lancer au démarrage :

[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]# systemctl start httpd.service
[root@localhost ~]# systemctl enable mariadb.service
[root@localhost ~]# systemctl enable httpd.service

On définit un mot de passe admin pour mariaDB :

[root@localhost ~]# mysqladmin -u root password 'mariadb_admin_password'

On modifie le fichier /etc/my.cnf en ajoutant en dessous de [mysqld] :

innodb_file_per_table=1

On configure le bon timezone pour PHP dans /etc/php.ini :

date.timezone = Europe/Zurich

et on relance apache et mariadb pour tout prendre en compte :

[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl restart mariadb

Prérequis pour compilation et dépendances centreon

L’installation à partir des sources passe par la case compilation, on as donc besoin d’un certains nombre d’outils additionnels :

[root@localhost ~]# yum install cmake make gcc gcc-c++ libxml2 libxml2-devel pango pango-devel perl-devel m4 automake perl-ExtUtils-Embed libssh2-devel libgcrypt-devel libgpg-error-devel gnutls-devel qt rrdtool rrdtool-devel qt4-devel qt4-mysql

Dépendances centreon

Centreon a besoin des dépendances suivantes pour fonctionner :

[root@localhost ~]# mailx php-pear net-snmp php-gd php-ldap php-mbstring php-intl redhat-lsb rrdtool-perl-1.4.8-9.el7.x86_64 net-snmp-perl perl-Net-SNMP perl-Config-IniFiles.noarch 0:2.79-1.el7

Création d’utilisateur

Centreon a besoin de plusieurs utilisateurs pour fonctionner :

  • centreon
  • centreon-engine
  • centreon-broker

L’utilisateur centreon sera créé automatiquement. Par contre il faut créer les autres à la main :

[root@localhost ~]# useradd centreon-engine
[root@localhost ~]# useradd centreon-broker

Arborescence

Lors de l’installation de centreon-web, le script install.sh crée une arborescence. Pour autant certains répertoires sont absent et il faut donc les créer à la main :

[root@localhost ~]# mkdir /var/log/centreon-engine
[root@localhost ~]# mkdir /var/lib/centreon-engine
[root@localhost ~]# mkdir /etc/centreon-engine
[root@localhost ~]# mkdir /etc/centreon-broker
[root@localhost ~]# mkdir /var/lib/centreon-broker
[root@localhost ~]# mkdir /var/log/centreon-broker
[root@localhost ~]# chown centreon-broker:centreon-broker /var/log/centreon-broker
[root@localhost ~]# chown centreon-engine:centreon-engine /var/log/centreon-engine
[root@localhost ~]# chown centreon-broker:centreon-broker /var/lib/centreon-broker
[root@localhost ~]# chown centreon-engine:centreon-engine /var/lib/centreon-engine
[root@localhost ~]# chmod 775 /var/log/centreon-broker
[root@localhost ~]# chmod 775 /var/log/centreon-engine
[root@localhost ~]# chmod 775 /var/lib/centreon-broker
[root@localhost ~]# chmod 775 /var/lib/centreon-engine

Init scripts /etc/init.d/cbd

Les installations via la compilation ne crée pas ce script de service qui est nécessaire au fonctionnement de centreon. Ce script provient d’une installation de Centreon 2.7.x sur Centos 6.6 :

#!/bin/sh
##
## Copyright 2009-2012,2015 Centreon
##re
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
#### Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
#### For more information : contact@centreon.com
##

#
# Script init
#
### BEGIN INIT INFO Redhat
# chkconfig: - 71 31
# description: Centreon Broker
# processname: cbd
# config: TO_CHANGE
# pidfile: TO_CHANGE
### END INIT INFO

# Select distribution type.
. /etc/init.d/functions

# Configuration parameters.
master_file="/etc/centreon-broker/master.run"
config_dir="/etc/centreon-broker"
cbd="/usr/sbin/cbd"
pid_path=/var/run
lockfile=/var/lock/subsys/cbd
stop_timeout=10
user="centreon-broker"

# Check that cbd is executable.
if [ ! -x "${cbd}" ] ; then
echo "The cbd binary can't be run."
exit 1
fi

# Check that configuration file exists.
if [ ! -e "${master_file}" ] ; then
echo "The master file isn't found."
exit 1
fi

# Start cbd.
start_all() {
global_retval=0
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" = "y" ]; then
if [ -f "${pidfile}" ] ; then
is_running=$(ps -edf | grep "${cbd} ${daemon_config}" | grep -v grep | wc -l )
if [ $is_running = 0 ] ; then
rm -f "${pidfile}"
rm -f "${lockfile}"
else
echo -n "${daemon_name} already running"
failure "cbd startup"
return 1
fi
fi

# Start cbd.
echo -n "Starting ${daemon_name}: "
PID=`su - "${user}" -c "${cbd} ${daemon_config} >/dev/null 2>&1 & echo \\$!"`
RETVAL=$?
if [ ${RETVAL} = 0 ]; then
echo ${PID} > "${pidfile}"
touch "${lockfile}"
success "cbd startup"
else
${global_retval} = ${RETVAL}
failure "cbd startup"
fi
echo
fi
done
return ${global_retval}
}

start_one() {
grep "^$1[[:space:]]" ${master_file} &>/dev/null
if [ $? -ne 0 ]; then
echo "Daemon is not found"
return 1
fi
line=$(grep "^$1[[:space:]]" ${master_file})
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" != "y" ]; then
echo "Daemon is set to not running"
return 1
fi
# Start cbd.
echo -n "Starting ${daemon_name}: "
PID=`su - "${user}" -c "${cbd} ${daemon_config} >/dev/null 2>&1 & echo \\$!"`
RETVAL=$?
if [ ${RETVAL} = 0 ]; then
echo ${PID} > "${pidfile}"
touch "${lockfile}"
success "cbd startup"
else
${global_retval} = ${RETVAL}
failure "cbd startup"
fi
echo
}

# Stop cbd.
stop_all() {
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" = "y" ]; then
echo -n "Stopping ${daemon_name}: "
killproc -p "${pidfile}" -d ${stop_timeout} "$cbd"
RETVAL=$?
if [ ${RETVAL} = 0 ] ; then
rm -f "${pidfile}"
success "cbd shutdown"
else
failure "cbd shutdown"
fi
echo
fi
done
remaining_cbd=0
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ -e "${pidfile}" ] ; then
remaining_cbd=1
fi
done
if [ "${remaining_cbd}" = 0 ] ; then
rm -f "${lockfile}"
fi
}

stop_one() {
grep "^$1[[:space:]]" ${master_file} &>/dev/null
if [ $? -ne 0 ]; then
echo "Daemon is not found"
return 1
fi
line=$(grep "^$1[[:space:]]" ${master_file})
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" != "y" ]; then
echo "Daemon is set to not running"
return 1
fi
echo -n "Stopping ${daemon_name}: "
killproc -p "${pidfile}" -d ${stop_timeout} "$cbd"
RETVAL=$?
if [ ${RETVAL} = 0 ] ; then
rm -f "${pidfile}"
remaining_cbd=0
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ -e "${pidfile}" ] ; then
remaining_cbd=1
fi
done
if [ "${remaining_cbd}" = 0 ] ; then
rm -f "${lockfile}"
fi
success "cbd shutdown"
else
failure "cbd shutdown"
fi
echo
}

# Send kill HUP
reload_all() {
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
reload="$(echo ${line} | awk '{ print $4 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${reload}" = "y" ]; then
echo -n "Reloading ${daemon_name}: "
killproc -p "${pidfile}" "${cbd}" -HUP
RETVAL=$?
if [ ${RETVAL} = 0 ]; then
success "cbd reload"
else
failure "cbd reload"
fi
echo
fi
done
}

# Check status on one daemon
status_one() {
grep "^$1[[:space:]]" ${master_file} &>/dev/null
if [ $? -ne 0 ]; then
echo "Daemon is not found"
return 1
fi
line=$(grep "^$1[[:space:]]" ${master_file})
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" != "y" ]; then
echo "Daemon is set to not running"
return 1
fi
status -p ${pidfile} ${cbd}
return $?
}

# Status
status_all() {
cat ${master_file} | grep -v '^#'| while read line; do
daemon_name="cbd_$(echo ${line} | awk '{ print $1 }')"
daemon_config="${config_dir}/$(echo ${line} | awk '{ print $2 }')"
running="$(echo ${line} | awk '{ print $3 }')"
pidfile="${pid_path}/${daemon_name}.pid"
if [ "${running}" = "y" ]; then
status -p ${pidfile} ${cbd}
fi
done
}

# Switch case.
case "$1" in
start)
if [ -n "$2" ]; then
start_one $2
RETVAL=$?
else
start_all
RETVAL=$?
fi
;;
stop)
if [ -n "$2" ]; then
stop_one $2
RETVAL=$?
else
stop_all
RETVAL=$?
fi
;;
restart)
if [ -n "$2" ]; then
stop_one $2
start_one $2
RETVAL=$?
else
stop_all
start_all
RETVAL=$?
fi
;;
reload)
reload_all
;;
status)
if [ -n "$2" ]; then
status_one $2
RETVAL=$?
else
status_all
RETVAL=$?
fi
;;
*)
echo "Usage: ${daemon_name} {start|stop|restart|status}"
exit 1
esac

exit ${RETVAL}

Il faut ensuite rendre ce fichier exécutable :

[root@localhost ~]# chmod +x /etc/init.d/cbd

Il faut créer le script /etc/centreon-broker/master.run :

## This file define the Centreon Broker daemons to start
# Example :
# central-cbd central-cbd.xml y y
# central-rrd central-rdd.xml y n
#
# The first line the daemon central-cbd is started with start action from
# /etc/init.d/cbd and it's reload by action reload of init script
#
# The second line the daemon central-rrd is started but it is not reload by
# action in /etc/cbd reload
#
#
# daemon_name daemon_config running reload
central-broker central-broker.xml y y
central-rrd central-rrd.xml y y

et donner les droits correct sur ce fichier :

[root@localhost ~]# chmod 775 /etc/centreon-broker/master.run
[root@localhost ~]# chown centreon-broker:centreon-broker /etc/centreon-broker/master.run

Selinux

Il faut désactiver selinux :

[root@localhost ~]# setenforce 0

et modifier le fichier /etc/selinux/config pour que SELinux reste désactivé au redémarrage :

SELINUX=disabled

Installation des briques centreon

Centreon est composé de plusieurs briques :

  • centreon-clib
  • centreon-engine
  • centreon-broker
  • nagios-plugin
  • centreon-connector

Installation de centreon-clib depuis les sources

Récupération des sources depuis le site https://download.centreon.com (onglet centreon-core) :

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-clib/centreon-clib-1.4.2.tar.gz
[root@localhost ~]# tar -xvf centreon-clib-1.4.2.tar.gz
[root@localhost ~]# rm centreon-clib-1.4.2.tar.gz
[root@localhost ~]# cd centreon-clib-1.4.2/build
[root@localhost ~]# cmake .
[root@localhost ~]# make
[root@localhost ~]# make install
[root@localhost ~]# cp /usr/local/lib/libcentreon_clib.so /lib64/

Installation de centreon-engine :

Récupération des sources depuis le site https://download.centreon.com (onglet centreon-core) :

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-engine/centreon-engine-1.5.0.tar.gz
[root@localhost ~]# tar -xvf ./centreon-engine-1.5.0.tar.gz
[root@localhost ~]# rm centreon-engine-1.5.0.tar.gz
[root@localhost ~]# cd centreon-engine-1.5.0/build
[root@localhost ~]# cmake .
[root@localhost ~]# make
[root@localhost ~]# make install

Installation de centreon-broker :

Récupération des sources depuis le site https://download.centreon.com ( onglet centreon-core) :

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-broker/centreon-broker-2.11.4.tar.gz
[root@localhost ~]# tar -xvf ./centreon-broker-2.11.4.tar.gz
[root@localhost ~]# rm centreon-broker-2.11.4.tar.gz
[root@localhost ~]# cd centreon-broker-2.11.4/build
[root@localhost ~]# cmake .
[root@localhost ~]# make
[root@localhost ~]# make install
[root@localhost ~]# cp bin/cbd /usr/sbin/cbd

Installation de nagios-plugin :

Récupération des sources depuis http://www.nagios.org/downloads

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget http://www.nagios.org/nagios-plugins-2.1.1.tar.gz
[root@localhost ~]# tar -xvf nagios-plugins-2.1.1.tar.gz
[root@localhost ~]# rm nagios-plugins-2.1.1.tar.gz
[root@localhost ~]# cd nagios-plugins-2.1.1
[root@localhost ~]# ./configure
[root@localhost ~]# make
[root@localhost ~]# make install

Installation de centreon-connector

Récupération des sources depuis le site https://download.centreon.com ( onglet centreon-core) :

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-connectors/centreon-connector-1.1.2.tar.gz
[root@localhost ~]# tar -xvf centreon-connector-1.1.2.tar.gz
[root@localhost ~]# rm centreon-connector-1.1.2.tar.gz
[root@localhost ~]# cd centreon-connector-1.1.2/perl/build
[root@localhost ~]# cmake .
[root@localhost ~]# make -j 4
[root@localhost ~]# make install

Installation de centreon-web

L’installation de centreon-web se déroule en deux partie. La première est l’exécution d’un script dans un terminal qui va permettre de configurer centreon. La deuxième se déroule via une interface web.

Le script install.sh

Récupération des sources depuis le site https://download.centreon.com (onglet centreon-web) :

[root@localhost ~]# cd /usr/local/
[root@localhost ~]# wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon/centreon-web-2.7.4.tar.gz
[root@localhost ~]# tar -xvf centreon-web-2.7.4.tar.gz
[root@localhost ~]# rm centreon/centreon-web-2.7.4.tar.gz
[root@localhost ~]# cd centreon-web-2.7.4
[root@localhost centreon-web-2.7.4]# ./install.sh -i

Le script commence par vérifier si les dépendances sont Ok :

###############################################################################
# #
# Centreon (www.centreon.com) #
# Thanks for using Centreon #
# #
# v2.7.0 #
# #
# infos@centreon.com #
# #
# Make sure you have installed and configured #
# sudo - sed - php - apache - rrdtool - mysql #
# #
###############################################################################
------------------------------------------------------------------------
Checking all needed binaries
------------------------------------------------------------------------
rm OK
cp OK
mv OK
/bin/chmod OK
/bin/chown OK
echo OK
more OK
mkdir OK
find OK
/bin/grep OK
/bin/cat OK
/bin/sed OK

You will now read Centreon Licence.
Press enter to continue.

Ensuite, il faut accepter la licence de Centreon (licence GPL Version 2), Si vous refusez cette licence, vous abandonnez l’installation :

This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

Do you accept GPL license ?
[y/n], default to [n]:
> y

Le module d’installation va alors vous demander si vous souhaitez installer les modules suivants :

  • l’interface Web Centreon
  • Centcore
  • les plugins Centreon
  • les Traps handler Centreon

Nous utiliserons tous ces modules.

------------------------------------------------------------------------
Please choose what do you want to install
------------------------------------------------------------------------

Do you want to install Centreon Web Front
[y/n], default to [n]:
> y

Do you want to install Centreon CentCore
[y/n], default to [n]:
> y

Do you want to install Centreon Nagios Plugins
[y/n], default to [n]:
> y

Do you want to install Centreon Snmp Traps process
[y/n], default to [n]:
> y

Le script d’installation va maintenant procéder à l’installation des différents modules.
En commençant par Centreon Web, l’interface de centreon.

------------------------------------------------------------------------
Start CentWeb Installation
------------------------------------------------------------------------

Where is your Centreon directory?
default to [/usr/local/centreon]
>/usr/share/centreon
Path /usr/share/centreon OK
Where is your Centreon log directory
default to [/usr/local/centreon/log]
> /var/log/centreon

Do you want me to create this directory ? [/var/log/centreon]
[y/n], default to [n]:
> y
Path /var/log/centreon OK
Where is your Centreon log directory
default to [/usr/local/centreon/log]
> /var/log/centreon

Do you want me to create this directory ? [/var/log/centreon]
[y/n], default to [n]:
> y
Path /var/log/centreon OK
Where is your Centreon etc directory
default to [/etc/centreon]
>

Do you want me to create this directory ? [/etc/centreon]
[y/n], default to [n]:
> y
Path /etc/centreon OK

Where is your Centreon binaries directory
default to [/usr/local/centreon/bin]
> /usr/share/centreon/bin

Do you want me to create this directory ? [/usr/share/centreon/bin]
[y/n], default to [n]:
> y
Path /usr/share/centreon/bin OK

Where is your Centreon data informations directory
default to [/usr/local/centreon/data]
> /usr/share/centreon/data

Do you want me to create this directory ? [/usr/share/centreon/data]
[y/n], default to [n]:
> y
Path /usr/share/centreon/data OK

Where is your Centreon variable library directory?
default to [/var/lib/centreon]
>

Do you want me to create this directory ? [/var/lib/centreon]
[y/n], default to [n]:
> y
Path /var/lib/centreon OK
/usr/bin/rrdtool OK
/usr/bin/mail OK
/usr/bin/php OK

Where is PEAR [PEAR.php]
default to [/usr/share/php/PEAR.php]
> /usr/share/pear/PEAR,php
Path /usr/share/php OK
/usr/bin/perl OK
Finding Apache user : apache
Finding Apache group : apache

Utilisation d’un groupe centreon et d’un utilisateur centreon :

What is the Centreon group ? [centreon]
default to [centreon]
>

Do you want me to create this group ? [centreon]
[y/n], default to [n]:
> y

What is the Centreon user ? [centreon]
default to [centreon]
>
Do you want me to create this user ? [centreon]
[y/n], default to [n]:
> y

Choisissez le moteur centreon-engine et le broker centreon-broker. Indiquez le chemin des plugins :

What is the Monitoring engine user ?
> centreon-engine

What is the Broker user ? (optional)
> centreon-broker

What is the Monitoring engine log directory ?
> /var/log/centreon-engine

Where is your monitoring plugins (libexec) directory ?
default to [/usr/lib/nagios/plugins]
> /usr/local/nagios
Path /usr/lib/nagios/plugins OK
Add group centreon to user www-data OK
Add group centreon to user centreon-engine OK
Add group centreon-engine to user www-data OK
Add group centreon-engine to user centreon OK

Configuration de sudo :

------------------------------------------------------------------------
Configure Sudo
------------------------------------------------------------------------

Where is sudo configuration file
default to [/etc/sudoers]
>
/etc/sudoers OK

What is the Monitoring engine init.d script ?
> /etc/init.d/centengine

What is the Monitoring engine binary ?
> /usr/local/bin/centengine

What is the Monitoring engine configuration directory ?
> /etc/centreon-engine

Where is the configuration directory for broker module ?
> /etc/centreon-broker

Where is the init script for broker module daemon ?
> /etc/init.d/cbd
Your sudo is not configured

Do you want me to configure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK

Configuration du serveur apache :

------------------------------------------------------------------------
Configure Apache server
------------------------------------------------------------------------

Do you want to add Centreon Apache sub configuration file ?
[y/n], default to [n]:
> y
Create '/etc/apache2/conf-available/centreon.conf' OK
Configuring Apache OK

Do you want to reload your Apache ?
[y/n], default to [n]:
> y
Reloading Apache service OK
Preparing Centreon temporary files
Change right on /var/log/centreon OK
Change right on /etc/centreon OK
Change macros for insertBaseConf.sql OK
Change macros for sql update files OK
Change macros for php files OK
Change macros for php config file OK
Change macros for perl binary OK
Change right on /etc/centreon-engine OK
Add group centreon-broker to user www-data OK
Add group centreon-broker to user centreon-engine OK
Add group centreon to user centreon-broker OK
Change right on /etc/centreon-broker OK
Copy CentWeb in system directory
Install CentWeb (web front of centreon) OK
Change right for install directory
Change right for install directory OK
Install libraries OK
Write right to Smarty Cache OK
Copying libinstall OK
Change macros for centreon.cron OK
Install Centreon cron.d file OK
Change macros for centAcl.php OK
Change macros for downtimeManager.php OK
Install cron directory OK
Change right for eventReportBuilder OK
Change right for dashboardBuilder OK
Change macros for centreon.logrotate OK
Install Centreon logrotate.d file OK
Prepare centFillTrapDB OK
Install centFillTrapDB OK
Prepare centreon_trap_send OK
Install centreon_trap_send OK
Prepare centreon_check_perfdata OK
Install centreon_check_perfdata OK
Prepare centreonSyncPlugins OK
Install centreonSyncPlugins OK
Prepare centreonSyncArchives OK
Install centreonSyncArchives OK
Install generateSqlLite OK
Install changeRrdDsName.pl OK
Prepare export-mysql-indexes OK
Install export-mysql-indexes OK
Prepare import-mysql-indexes OK
Install import-mysql-indexes OK
Prepare clapi binary OK
Install clapi binary OK
Centreon Web Perl lib installed OK

------------------------------------------------------------------------
Pear Modules
------------------------------------------------------------------------
Check PEAR modules
PEAR 1.4.9 1.9.5 OK
DB 1.7.6 NOK
DB_DataObject 1.8.4 NOK
DB_DataObject_FormBuilder 1.0.0RC4 NOK
MDB2 2.0.0 NOK
Date 1.4.6 NOK
Archive_Tar 1.1 1.3.12 OK
Auth_SASL 1.0.1 NOK
Console_Getopt 1.2 1.3.1 OK
Validate 0.6.2 NOK
Log 1.9.11 NOK
Archive_Zip 0.1.2 NOK

Do you want me to install/upgrade your PEAR modules
[y/n], default to [y]:
> y

Les modules Pear ne sont pas à jour, répondre y pour les mettre à jour automatiquement :

Upgrading PEAR modules
Installing PEAR modules
DB 1.7.6 1.9.2 OK
DB_DataObject 1.8.4 1.11.5 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
Auth_SASL 1.0.1 1.0.6 OK
Validate 0.6.2 0.8.5 OK
Log 1.9.11 1.12.9 OK
Archive_Zip 0.1.2 0.1.2 OK
Check PEAR modules
PEAR 1.4.9 1.10.1 OK
DB 1.7.6 1.9.2 OK
DB_DataObject 1.8.4 1.11.5 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
Date 1.4.6 1.4.7 OK
Archive_Tar 1.1 1.3.12 OK
Auth_SASL 1.0.1 1.0.6 OK
Console_Getopt 1.2 1.3.1 OK
Validate 0.6.2 0.8.5 OK
Log 1.9.11 1.12.9 OK
Archive_Zip 0.1.2 0.1.2 OK
All PEAR modules OK
------------------------------------------------------------------------
Centreon Post Install
------------------------------------------------------------------------
Create /usr/share/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf OK

PEAR étant à jour, nous continuons avec l’installation de CentStorage. Laissez par défaut :

------------------------------------------------------------------------
Start CentStorage Installation
------------------------------------------------------------------------

Where is your Centreon Run Dir directory?
default to [/var/run/centreon]
>

Do you want me to create this directory ? [/var/run/centreon]
[y/n], default to [n]:
> y
Path /var/run/centreon OK

Where is your CentStorage binary directory
default to [/usr/share/centreon/bin]
>
Path /usr/share/centreon/bin OK

Where is your CentStorage RRD directory
default to [/var/lib/centreon]
>
Path /var/lib/centreon OK
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
install www/install/createTablesCentstorage.sql OK
Creating Centreon Directory '/var/lib/centreon/status' OK
Creating Centreon Directory '/var/lib/centreon/metrics' OK
Change right : /var/run/centreon OK
Install logAnalyserBroker OK
Install nagiosPerfTrace OK
Change macros for centstorage.cron OK
Install CentStorage cron OK
Change macros for centstorage.logrotate OK
Install Centreon Storage logrotate.d file OK
Create /etc/centreon/instCentStorage.conf OK

Installation du module CentCore.

------------------------------------------------------------------------
Start CentCore Installation
------------------------------------------------------------------------

Where is your CentCore binary directory
default to [/usr/share/centreon/bin]
>
Path /usr/share/centreon/bin OK
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Copy CentCore in binary directory OK
Change right : /var/run/centreon OK
Change right : /var/lib/centreon OK
Change macros for centcore.logrotate OK
Install Centreon Core logrotate.d file OK
Replace CentCore init script Macro OK
Replace CentCore default script Macro OK

Do you want me to install CentCore init script ?
[y/n], default to [n]:
> y
CentCore init script installed OK
CentCore default script installed OK

Do you want me to install CentCore run level ?
[y/n], default to [n]:
> y
CentCore Perl lib installed OK
Create /etc/centreon/instCentCore.conf OK

Installation des plugins pour les Traps SNMP, répondre y pour la création des dossiers :

------------------------------------------------------------------------
Start CentPlugins Installation
------------------------------------------------------------------------

Where is your CentPlugins lib directory
default to [/var/lib/centreon/centplugins]
>

Do you want me to create this directory ? [/var/lib/centreon/centplugins]
[y/n], default to [n]:
> y
Path /var/lib/centreon/centplugins OK
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change macros for CentPlugins OK
Installing the plugins OK
Change right on centreon.conf OK
CentPlugins is installed
Create /etc/centreon/instCentPlugins.conf OK

------------------------------------------------------------------------
Start CentPlugins Traps Installation
------------------------------------------------------------------------

Where is your SNMP configuration directory
default to [/etc/snmp]
>
/etc/snmp OK

Where is your CentreonTrapd binaries directory
default to [/usr/local/centreon/bin]
> /usr/share/centreon/bin

/usr/share/centreon/bin OK
Finding Apache user : apache
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change macros for snmptrapd.conf OK
Replace CentreonTrapd init script Macro OK
Replace CentreonTrapd default script Macro OK

Do you want me to install CentreonTrapd init script ?
[y/n], default to [n]:
> y
CentreonTrapd init script installed OK
CentreonTrapd default script installed OK

Do you want me to install CentreonTrapd run level ?
[y/n], default to [n]:
> y
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
trapd Perl lib installed OK
Install : snmptrapd.conf OK
Install : centreontrapdforward OK
Install : centreontrapd OK
Change macros for centreontrapd.logrotate OK
Install Centreon Trapd logrotate.d file OK
Create /etc/centreon/instCentPlugins.conf OK
###############################################################################
# #
# Go to the URL : http://localhost/centreon/ #
# to finish the setup #
# #
# Report bugs at http://forge.centreon.com #
# #
# Thanks for using Centreon. #
# ----------------------- #
# Contact : infos@centreon.com #
# http://www.centreon.com #
# #
###############################################################################

Configuration du poller

Il arrive que le script de lancement du poller ne soit pas correctement configuré. Dans le script /etc/init.d/centengine il faut remplacer :

var_dir=/usr/local/var
...
config_file=/usr/local/etc/centengine.cfg

par

var_dit=/var/log/centreon-engine
...
config_file=/etc/centreon-engine/centengine.cfg

Il faut maintenant terminer l’installation en mode Web.

Installation via l’interface web

Vérifications :

On s’assure que le service httpd est bien lancé :

[root@localhost ~]# systemctl status httpd

Sinon on le lance avec :

[root@localhost ~]# systemctl start httpd

Configuration apache2

Apache2 est installé en version 2.4 or le fichier de configuration intégré à l’installation de Centreon est un fichier prévu pour apache 2.2. Il faut donc modifier les lignes :

Order allow,deny
Alloy from all

en

Require all granted

dans le fichier /etc/httpd/conf.d/centreon.conf et relancer http :

[root@localhost ~]# systemctl restart httpd

On peut ensuite finir l’installation en se rendant sur http://localhost/centreon

Installation via l’interface web

install1

On clique sur next

install2

Si l’un des modules est manquant il suffit de l’installer via

yum le paquet php-nom_module_manquant

puis de relancer apache/httpd pour que tout rentre dans l’ordre. Attention sous RHEL 7 les paquets correspondant à ces modules sont dans le dépôt « server-optionnal » qui n’est pas activé par défaut.

On choisit « centreon-engine » comme moteur de supervision centreon-engine :

Centreon Engine directory: /usr/local/centreon-engine-1.5.0
Centreon Engine Stats binary: /usr/local/bin/centenginestats
Centreon Engine var lib directory: /var/lib/centreon-engine
Centreon Engine Connector path: /usr/local/centreon-connector-1.1.2
Centreon Engine Library (*.so) directory: /usr/local/lib/centreon-engine

install3

On choisit « centreon-broker » comme broker :

Centreon Broker etc directory: /etc/centreon-broker
Centreon Broker module (cbmod.so): /usr/local/lib/cbmod.so
Centreon Broker log directory: /var/log/centreon-broker
Retention file directory: /var/lib/centreon-broker
Centreon Broker lib (*.so) directory: /usr/local/lib/centreon-broker

install4

Ensuite on définit les identifiants du compte administrateur :

install5

Puis on définit les accès à la base de données :

install6

Centreon génère les bases de données :

install7

L’installation est maintenant terminée :

install8

Vous pouvez vous connecter sur http://localhost/centreon en utilisant les identifiants définit lors de la 5eme page de l’installation web.

L’installation est maintenant fonctionnelle, on peut créer des objets centreon (hosts, templates, commandes, services, …), mettre à jour la configuration, fabriquer des graphs etc.

install_final

 

7 réponses
  1. Fabio
    Fabio dit :

    Bonjour,
    merci beaucoup pour vostre guide et excusez moi d’abord pour mes erreurs, je ne parle pas très bien le Francais.
    J’ai reussi à installer tous les paquets, j’ai seulement trouvé quelques petits manques, mais peut-etre qu’ils dependent de mon environnement (CentOS 7):

    – pour configurer MariaDB et httpd pour le lance au demarrage j’ai utilisé
    systemctl enable mariadb
    systemctl enable httpd
    – le nouveau parcours de nagios plugins est « http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz »

    Je n’ai pas trouvé le répertoires « var/lib/centreon-engine » et « var/lib/centreon-broker » indiquées dans l’interface web, j’ai les ai crées à la main. C’est ma faute?

    Merci encore, salut

    Fabio

    Répondre
    • Gauthier Malfait
      Gauthier Malfait dit :

      Bonjour Fabio,

      Merci pour ces remarques je vais mettre à jour l’article. Concernant les répertoires « var/lib/centreon-engine » et « var/lib/centreon-broker » ils ne sont pas systématiquement créer.

      Répondre
  2. rza
    rza dit :

    Bonjour,
    Je n’arrive pas à vous joindre sur votre autre tuto, installation de centreon 2.7
    J’ai suivi la procédure mais le centreon broker ne démarre pas
    systemctl start cbd.service failed

    systemctl start cbd
    Job for cbd.service failed because the control process exited with error code. See “systemctl status cbd.service” and “journalctl -xe” for details.

    systemctl status cbd
    â cbd.service – SYSV: Centreon Broker
    Loaded: loaded (/etc/rc.d/init.d/cbd)
    Active: failed (Result: exit-code) since lun. 2016-11-07 14:29:45 CET; 28s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 60755 ExecStart=/etc/rc.d/init.d/cbd start (code=exited, status=1/FAILURE)

    nov. 07 14:29:45 localhost.localdomain systemd[1]: Starting SYSV: Centreon Broker…
    nov. 07 14:29:45 localhost.localdomain cbd[60755]: The cbd binary can’t be run.
    nov. 07 14:29:45 localhost.localdomain systemd[1]: cbd.service: control process exited, code=exite…s=1
    nov. 07 14:29:45 localhost.localdomain systemd[1]: Failed to start SYSV: Centreon Broker.
    nov. 07 14:29:45 localhost.localdomain systemd[1]: Unit cbd.service entered failed state.
    nov. 07 14:29:45 localhost.localdomain systemd[1]: cbd.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.

    Comment fixer cette erreur svp ?

    Répondre
    • Gauthier Malfait
      Gauthier Malfait dit :

      Bonjour,

      l’erreur « The cbd binary can’t be run. » précise que le script d’init ne trouve pas le programme cbd. Normalement ce programme se trouve ici : /usr/sbin/cbd

      Pourriez vous vérifiez que ce fichier existe ? et s’il possède les droits root:root 755 ?

      Si ce programme est installé dans un autre emplacement il faudra modifier la ligne :

      cbd= »/usr/sbin/cbd »

      au début du script d’init /etc/init.d/cbd.

      Répondre
      • Pierre
        Pierre dit :

        Bonjour,

        J’ai le même problème, il n’existe pas de fichier /usr/sbin/cbd et je ne trouve pas son emplacement.

        Auriez-vous une solution à ce problème ?

        Merci d’avance

        Répondre
        • Gauthier Malfait
          Gauthier Malfait dit :

          Bonjour Pierre,

          le fichier /etc/init.d/cbd est à créer à la main. Le code est présent dans l’article, Chapitre « Préparation », rubriques « INIT SCRIPTS /ETC/INIT.D/CBD ».

          Pour le fichier /usr/sbin/cbd il est compilé lors de la création du centreon-broker. Il est présent dans /usr/local/centreon-broker/bin/cbd. Il faut le déplacer dans /usr/sbin/cbd.

          Je vais mettre à jour l’article en conséquence.

          Cordialement

          Répondre
  3. Oscar Calles Saez
    Oscar Calles Saez dit :

    Hi,
    Thank you fo this tutorial, I found a error when compile the centreon-broker, solved with:
    yum install rrdtool-devel

    Please check this line in the tutorial:
    PRÉREQUIS POUR COMPILATION ET DÉPENDANCES CENTREON
    L’installation à partir des sources passe par la case compilation, on as donc besoin d’un certains nombre d’outils additionnels :

    ………. rrd-tool-devel …………

    Hope this help.

    Répondre

Laisser un commentaire

Participez-vous à la discussion?
N'hésitez pas à contribuer!

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.