This is the continuation of
Installing Centreon 2.4 on CentOS 6.3 x64 - Step by Step
Preparing MySQL
## Add innodb_file_per_table=1 under the [mysqld] section in my.cnf
vim /etc/my.cnf
## then
service mysqld start
chkconfig mysqld on
#
Installing Centreon
#
service httpd start
groupadd centreon
useradd -g centreon centreon
cd /usr/local/src/
wget http://download.centreon.com/index.php?id=4264
tar -zxf centreon-2.4.0.tar.gz
cd centreon-2.4.0
export PATH="$PATH:/usr/local/nagios/bin/"
# create an answer file with the following contents:
vim ./answer
#
And create the answer file with the following content:
## CentWeb: Web front Centreon for Nagios
PROCESS_CENTREON_WWW=1
## CentStorage: Log and charts archiving.
PROCESS_CENTSTORAGE=1
## CentCore: Distributed Monitoring engine.
PROCESS_CENTCORE=1
## CentPlugins: Centreon Plugins for nagios
PROCESS_CENTREON_PLUGINS=1
## CentTraps: Centreon Snmp traps process for nagios
PROCESS_CENTREON_SNMP_TRAPS=1
#####################################################################
## Begin: Default variables
#####################################################################
## Your default variables
## $BASE_DIR is the centreon source directory
LOG_DIR="$BASE_DIR/log"
LOG_FILE="$LOG_DIR/install_centreon.log"
## Don't change values above unless you perfectly understand
## what you are doing.
## Centreon temporary directory to work
TMP_DIR="/tmp/centreon-setup"
## default snmp config directory
SNMP_ETC="/etc/snmp/"
## a list of pear modules require by Centreon
PEAR_MODULES_LIST="pear.lst"
#####################################################################
## End: Default variables
##################################################################
#####################################################################
## Begin: Centreon preferences
#####################################################################
## Above variables are necessary to run a silent install
## Where you want to install Centreon (Centreon root directory)
INSTALL_DIR_CENTREON="/usr/local/centreon"
## Centreon log files directory
CENTREON_LOG="/usr/local/centreon/log"
## Centreon config files
CENTREON_ETC="/etc/centreon"
## Where is your Centreon binaries directory ?
CENTREON_BINDIR="/usr/local/centreon/bin"
## Where is your Centreon data informations directory ?
CENTREON_DATADIR="/usr/local/centreon/data"
## Centreon generation config directory
## filesGeneration and filesUpload
## Where is your Centreon generation_files directory ?
CENTREON_GENDIR="/usr/local/centreon"
## libraries temporary files directory
## Where is your Centreon variable library directory ?
CENTREON_VARLIB="/var/lib/centreon"
## Where is your CentPlugins Traps binary?
CENTPLUGINSTRAPS_BINDIR="/usr/local/centreon/bin"
## Where is the RRD perl module installed [RRDs.pm]
## ATTENTION: ON x64 SYSTEMS THE PATH IS LIB64 INSTEAD OF LIB
## vv
RRD_PERL="/usr/lib64/perl5"
## What is the Centreon group ?
CENTREON_GROUP="centreon"
## What is the Centreon user ?
CENTREON_USER="centreon"
## What is the Monitoring engine user ?
MONITORINGENGINE_USER="nagios"
## What is the Monitoring engine group ?
MONITORINGENGINE_GROUP="nagios"
## What is the Monitoring engine log directory ?
MONITORINGENGINE_LOG="/usr/local/nagios/var"
## Where is your monitoring plugins (libexec) directory ?
PLUGIN_DIR="/usr/local/nagios/libexec"
## Path to sudoers file (optional)
## Where is sudo configuration file
SUDO_FILE="/etc/sudoers"
## What is the Monitoring engine init.d script ?
MONITORINGENGINE_INIT_SCRIPT="/etc/init.d/nagios"
## What is the Monitoring engine binary ?
MONITORINGENGINE_BINARY="/usr/local/nagios/bin/nagios"
## What is the Monitoring engine configuration directory ?
MONITORINGENGINE_ETC="/usr/local/nagios/etc"
## Where is the configuration directory for broker module ?
BROKER_ETC="/usr/local/nagios/etc"
## Where is the init script for broker module daemon ?
BROKER_INIT_SCRIPT="/etc/init.d/ndo2db"
## Do you want me to configure your sudo ? (WARNING)
FORCE_SUDO_CONF=1
#####################################################################
## Begin: Apache preferences
#####################################################################
## Apache configuration directory (optional)
#DIR_APACHE="/etc/apache"
## Apache local specific configuration directory (optional)
## Do you want to update Centreon Apache sub configuration file ?
# DIR_APACHE_CONF="/etc/apache/conf.d"
## Apache configuration file. Only file name. (optional)
#APACHE_CONF="apache.conf"
## Apache user (optional)
WEB_USER="apache"
## Apache group (optional)
WEB_GROUP="apache"
## Force apache reload (optional): set APACHE_RELOAD to 1
## Do you want to reload your Apache ?
APACHE_RELOAD=1
#####################################################################
## End: Apache preferences
#####################################################################
## Do you want me to install/upgrade your PEAR modules
PEAR_AUTOINST=1
## Centreon run dir (all .pid, .run, .lock)
## Where is your Centreon Run Dir directory?
CENTREON_RUNDIR="/var/run/centreon"
## path to centstorage binary
## Where is your CentStorage binary directory
CENTSTORAGE_BINDIR="/usr/local/centreon/bin"
## CentStorage RRDs directory (where .rrd files go)
## Where is your CentStorage RRD directory
CENTSTORAGE_RRD="/var/lib/centreon"
## Do you want me to install CentStorage init script ?
CENTSTORAGE_INSTALL_INIT=1
## Do you want me to install CentStorage run level ?
CENTSTORAGE_INSTALL_RUNLVL=1
## path to centcore binary
CENTCORE_BINDIR="usr/local/centreon/bin"
## force install init script (install in init.d)
## Set to "1" to enable
## Do you want me to install CentCore init script ?
CENTCORE_INSTALL_INIT=1
## force install run level for init script (add all link on rcX.d)
## Set to "1" to enable
## Do you want me to install CentCore run level
CENTCORE_INSTALL_RUNLVL=1
## Some plugins require temporary datas to process output.
## These temp datas are store in the CENTPLUGINS_TMP path.
## Where is your CentPlugins lib directory
CENTPLUGINS_TMP="/var/lib/centreon/centplugins"
## path for snmptt installation
SNMPTT_BINDIR="/usr/local/centreon/bin/"
## What is the Broker user ? (optional)
BROKER_USER=$MONITORINGENGINE_USER
## Nagios user (optional)
NAGIOS_USER="nagios"
## Nagios group (optional)
NAGIOS_GROUP="nagios"
## Centreon Connector PATH
## Mail (optional)
BIN_MAIL="/bin/mail"
##
Save the file and you're ready to install.
# install using the answer file
./install.sh -f ./answer
# After installation configure SELinux
yum -y install policycoreutils-python
semanage fcontext -a -t httpd_sys_rw_content_t "/usr/local/centreon(/.*)?"
restorecon -R /usr/local/centreon/
semanage fcontext -a -t httpd_sys_rw_content_t "/etc/centreon(/.*)?"
restorecon -R /etc/centreon
semanage fcontext -a -t httpd_sys_rw_content_t "/usr/local/nagios/var/spool(/.*)?"
semanage fcontext -a -t httpd_sys_content_t "/usr/local/nagios/share(/.*)?"
restorecon -R /usr/local/nagios/
semanage fcontext -a -t httpd_sys_content_t "/usr/share/php(/.*)?"
restorecon -R /usr/share/php
semanage fcontext -a -t httpd_sys_content_t "/usr/share/pear(/.*)?"
restorecon -R /usr/share/pear
# Restart some services
service httpd restart
service ndo2db restart
service nagios restart
#
When the installation is finished, open http://server/centreon/ in the browser.
Next, Next
At the third page:
- Nagios directory: /usr/local/nagios/
- Nagiostats binary: /usr/local/nagios/bin/nagiostats
- Nagios image directory: /usr/local/nagios/share/images
At the forth page:
- Broker Module: ndoutils
- Ndomod binary (ndomod.o): /usr/local/nagios/bin/ndomod.o
At the fifth page enter the details of the admin user.
At the 6th page you have to specify the db details. By default the mysql root password is blank.
After finishing the setup there'll be something wrong with the db so you'll have to go back to the shell to grant permissions for the centreon db user.
#
mysql -e "grant all on centreon.* to 'centreon'@localhost identified by 'CentreonDBPassword';"
mysql -e "grant all on centreon_storage.* to 'centreon'@localhost identified by 'CentreonDBPassword'"
mysql -e "grant all on centreon_status.* to 'centreon'@localhost identified by 'CentreonDBPassword';"
#