Setup Centreon

Centreon official web site: http://www.centreon.com/

Requirement

Use RHEL/CentOS as the init scripts assumes a Redhat style system.

Ndo2db

PHP

Make sure php is installed:

yum install \
 php-common \
 php-pear \
 php-mbstring \
 php-snmp \
 php-mysql \
 php-xml \
 php-cli \
 php-devel \
 php-ldap \
 php-pdo \
 php \
 php-gd 

Update pear repository:

pear channel-update pear.php.net

Install pre-fetched pear packages usr-share-pear.tar.gz:

tar -C /usr/share -zxvf usr-share-pear.tar.gz

Perl

Install required perl modules:

cpan install Module::Build Config::IniFiles

RRDTool

Make sure rrdtool is installed:

yum install rrdtool rrdtool-perl

Postfix

Use postfix instead of sendmail:

yum install postfix system-switch-mail

# select Postfix
system-switch-mail

Set SMTP gateway in /etc/postfix/main.cf:

relayhost = [mail.mydomain.com]

Installation (console part)

Reference the Centreon wiki at http://en.doc.centreon.com/Main_Page

# cd unpacked source
./install -i

Screen dump:

[root@centreon centreon-2.1.10]# ./install.sh -i
###############################################################################
#                                                                             #
#                         Centreon (www.centreon.com)                         #
#                          Thanks for using Centreon                          #
#                                                                             #
#                                    v2.1                                     #
#                                                                             #
#                              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.

    GNU GENERAL PUBLIC LICENSE
       Version 2, June 1991

...

Do you accept GPL license ?
[y/n], default to [n]:
> y
------------------------------------------------------------------------
Please choose what 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

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

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

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

Where is your Centreon etc directory
default to [/etc/centreon]
> 
Path /etc/centreon OK

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

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

Where is your CentPlugins Traps binary
default to [/usr/local/centreon/bin]
> 
Path /usr/local/centreon/bin OK

Where is the RRD perl module installed [RRDs.pm]
default to [/usr/lib/perl5/RRDs.pm]
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/RRDs.pm
Path /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi OK
/usr/bin/rrdtool OK
/bin/mail OK

Where is PEAR [PEAR.php] 
default to [/usr/share/php/PEAR.php]
> /usr/share/pear/PEAR.php
Path /usr/share/pear OK

Where is installed Nagios ?
default to [/usr/local/nagios]
> /usr/share/nagios
Path /usr/share/nagios OK

Where is your nagios config directory
default to [/usr/local/nagios/etc]
> /etc/nagios
Path /etc/nagios OK

Where is your Nagios var directory ?
default to [/usr/local/nagios/var]
> /var/lib/nagios
Path /var/lib/nagios OK

Where is your Nagios plugins (libexec) directory ?
default to [/usr/local/nagios/libexec]
> /usr/lib/nagios/plugins
Path /usr/lib/nagios/plugins OK
/usr/sbin/nagios OK

Where is your Nagios image directory ?
default to [/usr/local/nagios/share/images/logos]
> /usr/share/nagios/images/logos
Path /usr/share/nagios/images/logos OK
/usr/sbin/nagiostats OK
p1_file : /usr/sbin/p1.pl OK
/usr/bin/php OK
/usr/bin/perl  OK
Finding Apache group :apache
Finding Apache user :apache
Finding Nagios user :nagios
Finding Nagios group :nagios
/usr/local/bin/ndomod.o OK

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

Where is sudo configuration file
default to [/etc/sudoers]
> 
/etc/sudoersOK
Nagios init script OK
Your sudo is not configured

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

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

Do you want to add Centreon Apache sub configuration file ?
[y/n], default to [n]:
> y
Create '/etc/httpd/conf.d/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 /usr/local/centreon/log OK
Change right on /etc/centreon OK
Change right on /usr/share/nagios/images/logos OK
Install nagios documentation OK
Change macros for insertBaseConf.sql OK
Change macros for php files
Change macros for php files OK
Copy CentWeb in system directory
Install CentWeb (web front of centreon)  OK
Install libraries OK
Copying libinstall OK
Change macros for centreon.cron OK
Install Centreon cron.d file OK
Change macros for archiveDayLog OK
Change macros for centAcl.php OK
Install cron directory OK

------------------------------------------------------------------------
Pear Modules
------------------------------------------------------------------------
Check PEAR modules

Upgrading PEAR modules

...

Installing PEAR modules
DB_DataObject1.8.41.9.5 OK
DB_DataObject_FormBuilder1.0.0RC41.0.1 OK
MDB22.0.02.4.1 OK
HTML_QuickForm_advmultiselect1.1.01.5.1 OK
HTML_Table1.6.11.8.3 OK
Auth_SASL1.0.11.0.4 OK
Net_SMTP1.2.81.4.4 OK
Net_Traceroute0.210.21.3 OK
Net_Ping2.4.12.4.5 OK
Validate0.6.20.8.4 OK
SOAP0.10.10.12.0 OK
Log1.9.111.12.5 OK
Check PEAR modules
PEAR1.4.91.9.1 OK
DB1.7.61.7.13 OK
DB_DataObject1.8.41.9.5 OK
DB_DataObject_FormBuilder1.0.0RC41.0.1 OK
MDB22.0.02.4.1 OK
Date1.4.61.4.7 OK
HTML_Common1.2.21.2.5 OK
HTML_QuickForm3.2.53.2.12 OK
HTML_QuickForm_advmultiselect1.1.01.5.1 OK
HTML_Table1.6.11.8.3 OK
Archive_Tar1.11.3.1 OK
Auth_SASL1.0.11.0.4 OK
Console_Getopt1.21.2 OK
Net_SMTP1.2.81.4.4 OK
Net_Socket1.0.11.0.10 OK
Net_Traceroute0.210.21.3 OK
Net_Ping2.4.12.4.5 OK
Validate0.6.20.8.4 OK
XML_RPC1.4.51.5.0 OK
SOAP0.10.10.12.0 OK
Log1.9.111.12.5 OK
All PEAR modules OK

------------------------------------------------------------------------
Centreon Post Install
------------------------------------------------------------------------
Create /usr/local/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf  OK

------------------------------------------------------------------------
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/local/centreon/bin]
> 
Path /usr/local/centreon/bin OK

Where is your CentStorage RRD directory
default to [/var/lib/centreon]
> 
Path /var/lib/centreon OK
Finding Nagios group :nagios
Finding Nagios user :nagios
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 macros for centstorage binary OK
Install CentStorage binary OK
Install library for centstorage OK
Change right : /var/run/centreon OK
Change macros for centstorage init script OK

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

Do you want me to install CentStorage run level ?
[y/n], default to [n]:
> y
Change macros for logAnalyser OK
Install logAnalyser OK
Change macros for nagiosPerfTrace OK
Install nagiosPerfTrace OK
Change macros for purgeLogs OK
Install purgeLogs OK
Change macros for purgeCentstorage OK
Install purgeCentstorage OK
Change macros for centreonPurge.sh OK
Install centreonPurge.sh OK
Change macros for centstorage.cron OK
Install CentStorage cron OK
Create /etc/centreon/instCentStorage.conf  OK

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

Where is your CentCore binary directory
default to [/usr/local/centreon/bin]
> 
Path /usr/local/centreon/bin OK
/usr/bin/ssh OK
/usr/bin/scp OK
Finding Nagios group :nagios
Finding Nagios user :nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change CentCore Macro OK
Copy CentCore in binary directory OK
Change right : /var/run/centreon OK
Change right : /var/lib/centreon OK
Replace CentCore init script Macro OK

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

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

------------------------------------------------------------------------
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
Finding Nagios user :nagios
Finding Nagios group :nagios
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

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

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

Where is your SNMPTT binaries directory
default to [/usr/local/centreon/bin/]
> 
/usr/local/centreon/bin/ OK
Finding Nagios group :nagios
Finding Apache user :apache
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change macros for CentPluginsTraps OK
Installing the plugins Trap binaries  OK
Backup all your snmp files OK
Change macros for snmptrapd.conf OK
Change macros for snmptt.ini OK
Install : snmptrapd.conf OK
Install : snmp.conf OK
Install : snmptt.ini OK
Install : snmptt OK
Install : snmpttconvertmib OK
Create /etc/centreon/instCentPlugins.conf  OK
###############################################################################
#                                                                             #
#                 Go to the URL : http://your-server/centreon/                #
#                        to finish the setup                                  #
#                                                                             #
#                  Report bugs at http://forge.centreon.com                   #
#                                                                             #
#                         Thanks for using Centreon.                          #
#                          -----------------------                            #
#                        Contact : infos@centreon.com                         #
#                          http://www.centreon.com                            #
#                                                                             #
###############################################################################

Installation (web part)

Open the URL http://host/centreon/ to start web based setup.

Screen dumps for version 2.1.10:

Setup completed.

Generate initial configuration

Login the Centreon web UI as admin.

Go to Configuration → Nagios → nagios.cfg → Nagios CFG 1

Make sure the Lock file is correctly set:

Go to Configuration → Nagios → Generate

Check all check boxes except Restart Nagios.

Click the Export button.

Screen dump:

CGI.cfg settings

Go to Configuration → Nagios → cgi, set:

main_config_file=/etc/nagios/nagios.cfg
physical_html_path=/usr/share/nagios
url_html_path=/nagios
nagios_check_command=/usr/lib/nagios/plugins/check_nagios /var/lib/nagios/status.log 5 '/usr/sbin/nagios'
use_authentication=1
default_user_name=nagiosadmin
authorized_for_system_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
statusmap_background_image=logofullsize.jpg
default_statusmap_layout=4
default_statuswrl_layout=4
refresh_rate=90
ping_syntax=/bin/ping -n -c 5 $HOSTADDRESS$

Fix ndo2db.cfg bug

ndo2db.cfg missing lock_file

Edit /etc/nagios/ndo2db.cfg, set the lock_file setting manually:

lock_file=/var/run/ndo2db.pid

Copy the /etc/nagios/ndo2db.cfg to /etc/ndo2db.cfg, and modify the init script to use the moved cfg file.

A working ndo2db init script for CentOS 5.

Restart ndo2db ,and then Nagios to make sure the init scripts are working properly:

service ndo2db restart
service nagios restart

If they are OK, reboot the server and check all processes are started as expected:

pgrep -l "^cent*|^nagios|^ndo2db"

Sample ouput:

3201 centcore
3240 centstorage
3388 nagios
3408 ndo2db
3484 ndo2db

Fix "100% Undetermined" in reporting page

Repair the database:

su nagios
perl /usr/local/centreon/cron/archiveDayLog -r

Cautions

Must make sure the init scripts are working

  • Check variables defaults with reference to the generated nagios config files
  • Manually try the scripts
  • Use tools like ps ax to check for duplicate process or no process at all

Check the generated config files

Especially these on the generic-service and generic-host template:

  • Process performance data on/off
  • Notification on/off
  • Contact Groups
nagios/centreon/setup_centreon.txt · Last modified: 2011-02-03 12:46 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0