第三部分 Centreon的安装
Centreon作为Nagios的分布式监控管理平台,功能强大,在IT监控方面地位强势,它的底层使用Nagios监控软件,Nagios通过ndoutil模块将监控数据写入数据库,Centreon读取该数据并即时的展现监控信息,通过Centreon可以简单地管理和配置Nagios,因此,完全可以使用Centreon轻松搭建企业级分布式IT基础运维监控系统。
一、安装前提

二、安装Centreon监控系统中央服务器
1.系统软件要求(相关安装参考 第一部分:Nagios的安装与配置)
Linux操作系统软件包及PHP
rrdtool
perl-snmp
perl-rrdtool

perl相关组件支持
PHP及相关扩展应用库支持 :PEAR

缺失基础库和组件安装
pear install DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Arc_Tar Auth_SASL Console_Getopt Image_GraphViz Net_DIME ET- ET-IDNA_0.8.1 Net_SMTP Net_Socket Net_Traceroute-0.21.3 Net_Ping Numbers_Words-0.16.4 PHPUnit PHP_Compat Validate-0.8.5 XML_RPC SOAP-0.13.0 Log Mail Net_IDNA Archive_Zip --alldeps
下图记录了所有需要的基础库列表,直接执行上面的命令即可。

2.部署centreon监控系统
groupadd -g 9002 centreon && useradd -u 9002 -g centreon -d /home/centreon -c "centreon Admin" centreon
cd /usr/local/src && wget https://codeload.github.com/centreon/centreon/tar.gz/2.8.1 && tar xf 2.8.1 && centreon-2.8.1/ ./install -i
下面是安装的过程
###############################################################################
# #
# Centreon (www.centreon.com) #
# Thanks for using Centreon #
# #
# v2.7.3 #
# #
# 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
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
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 : CentreonTrapd process
[y/n], default to [n]:
> y
------------------------------------------------------------------------
Start CentWeb Installation
------------------------------------------------------------------------
Where is your Centreon directory?
default to [/usr/local/centreon]
>
Do you want me to create this directory ? [/usr/local/centreon]
[y/n], default to [n]:
> y
Path /usr/local/centreon OK
Where is your Centreon log directory
default to [/usr/local/centreon/log]
>
Do you want me to create this directory ? [/usr/local/centreon/log]
[y/n], default to [n]:
> y
Path /usr/local/centreon/log OK
Where is your Centreon etc directory
default to [/etc/centreon]
> /usr/local/centreon/etc
Do you want me to create this directory ? [/usr/local/centreon/etc]
[y/n], default to [n]:
> y
Path /usr/local/centreon/etc OK
Where is your Centreon binaries directory
default to [/usr/local/centreon/bin]
>
Do you want me to create this directory ? [/usr/local/centreon/bin]
[y/n], default to [n]:
> y
Path /usr/local/centreon/bin OK
Where is your Centreon data informations directory
default to [/usr/local/centreon/data]
> y
You select slash...
Where is your Centreon data informations directory
default to [/usr/local/centreon/data]
>
Do you want me to create this directory ? [/usr/local/centreon/data]
[y/n], default to [n]:
> y
Path /usr/local/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
/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/pear OK
/usr/bin/perl OK
Finding Apache user : apache
Finding Apache group : apache
What is the Centreon group ? [centreon]
default to [centreon]
>
Do you want me to create this group ? [centreon]
[y/n], default to [n]:
> y
Creating group centreon OK
What is the Centreon user ? [centreon]
default to [centreon]
>
Do you want me to create this user ? [centreon]
[y/n], default to [n]:
> y
useradd: invalid home directory ''
Could not create user centreon FAIL
The user centreon does not exist. CRITICAL
What is the Centreon user ? [centreon]
default to [centreon]
>
What is the Monitoring engine user ?
> nagios
/usr/local/src/centreon-2.8.1/libinstall/functions: line 2059: answer_with_testuser_optional: command not found
What is the Monitoring engine log directory ?
> nagios
nagios is not a directory or does not exist. CRITICAL
What is the Monitoring engine log directory ?
> /usr/local/nagios/var
Where is your monitoring plugins (libexec) directory ?
default to [/usr/lib/nagios/plugins]
> /usr/local/nagios/libexec
Path /usr/local/nagios/libexec OK
Where is your centreon plugins directory ?
default to [/usr/lib/centreon/plugins]
> /usr/local/centreon/plugins
/usr/local/centreon/plugins is not a directory or does not CRITICAL
Where is your centreon plugins directory ?
default to [/usr/lib/centreon/plugins]
> /usr/local/nagios/libexec
Path /usr/local/nagios/libexec OK
Add group centreon to user apache OK
Add group centreon to user nagios OK
Add group nagios to user apache OK
Add group nagios to user centreon OK
Add group apache to user centreon OK
------------------------------------------------------------------------
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/nagios
What is the Monitoring engine binary ?
> /usr/local/nagios/bin/nagios
What is the Monitoring engine configuration directory ?
> /usr/local/nagios/etc
Where is the configuration directory for broker module ?
> /usr/local/nagios/etc
Where is the init script for broker module daemon ?
> /etc/init.d/ndo2db
Your sudo is not configured
Do you want me to configure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK
------------------------------------------------------------------------
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 /usr/local/centreon/etc 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 /usr/local/nagios/etc 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
Change macros for centreon-backup.pl OK
Install cron directory OK
Change right for eventReportBuilder OK
Change right for dashboardBuilder OK
Change right for centreon-backup.pl OK
Change right for centreon-backup-mysql.sh 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
Prepare generateSqlLite 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.4 OK
DB 1.7.6 1.7.13 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.4.2 OK
Auth_SASL 1.0.1 1.0.6 OK
Console_Getopt 1.2 1.2.3 OK
Validate 0.6.2 0.8.5 OK
Log 1.9.11 1.13.1 OK
Archive_Zip 0.1.2 NOK
Do you want me to install/upgrade your PEAR modules
[y/n], default to [y]:
> y
Upgrading PEAR modules
Installing PEAR modules
Archive_Zip 0.1.2 0.1.2 OK
Check PEAR modules
PEAR 1.4.9 1.9.5 OK
DB 1.7.6 1.7.13 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.4.2 OK
Auth_SASL 1.0.1 1.0.6 OK
Console_Getopt 1.2 1.2.3 OK
Validate 0.6.2 0.8.5 OK
Log 1.9.11 1.13.1 OK
Archive_Zip 0.1.2 0.1.2 OK
All PEAR modules OK
------------------------------------------------------------------------
Centreon Post Install
------------------------------------------------------------------------
Create /usr/local/centreon/www/install/install.conf.php OK
Create /usr/local/centreon/etc/instCentWeb.conf OK
------------------------------------------------------------------------
Starting 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
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 /usr/local/centreon/etc/instCentStorage.conf OK
------------------------------------------------------------------------
Starting CentCore Installation
------------------------------------------------------------------------
Where is your CentCore binary directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/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 sysconfig script Macro OK
Do you want me to install CentCore init script ?
[y/n], default to [n]:
> y
CentCore init script installed OK
CentCore sysconfig script installed OK
Do you want me to install CentCore run level ?
[y/n], default to [n]:
> y
CentCore Perl lib installed OK
Create /usr/local/centreon/etc/instCentCore.conf OK
------------------------------------------------------------------------
Starting Centreon Plugins 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...
ls: cannot access /tmp/centreon-setup/src/plugins/src/check*centreon*: No such file or directory
ls: cannot access /tmp/centreon-setup/src/plugins/src/check_snmp*: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/centreon.pm: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/centreon.conf: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/check_meta_service: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/process-service-perfdata: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/submit_host_check_result: No such file or directory
/bin/sed: can't read /tmp/centreon-setup/src/plugins/src/submit_service_check_result: No such file or directory
Change macros for CentPlugins FAIL
chown: cannot access `/tmp/centreon-setup/final/plugins/Centreon': No such file or directory
Installing the plugins OK
Change right on centreon.conf OK
CentPlugins is installed
Create /usr/local/centreon/etc/instCentPlugins.conf OK
------------------------------------------------------------------------
Starting CentreonTrapD Installation
------------------------------------------------------------------------
/usr/local/src/centreon-2.8.1/libinstall/CentPluginsTraps.sh: line 22: locate_centeon_plugins: command not found
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/local/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 sysconfig script Macro OK
Do you want me to install CentreonTrapd init script ?
[y/n], default to [n]:
> y
CentreonTrapd init script installed OK
CentreonTrapd sysconfig script installed OK
Do you want me to install CentreonTrapd run level ?
[y/n], default to [n]:
> y
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 /usr/local/centreon/etc/instCentPlugins.conf OK
###############################################################################
# #
# Go to the URL : http://nagios.apicloud.com/centreon/ #
# to finish the setup #
# #
# Report bugs at https://github.com/centreon/centreon/issues #
# #
# Thanks for using Centreon. #
# ----------------------- #
# Contact : infos@centreon.com #
# http://www.centreon.com #
# #
###############################################################################
3.web配置:

刚刚报错:inil.so找不到 和php.ini中timzone没有设置,解决办法:yum install php-intl -y ,把 php.ini 里的 date.timezone 改成 Asia/Chongqing ,然后重启httpd。






=========================================================================




@南非波波
github:https://github.com/swht

浙公网安备 33010602011771号