设为首页 收藏本站
查看: 463|回复: 0

Install Centreon 2.4.5 with Nagios 3.5.1

[复制链接]

尚未签到

发表于 2019-1-14 10:10:44 | 显示全部楼层 |阅读模式
  注明:目前ndoutils 1.5只兼容nagios 3.x,所以无法使用nagios 4.x和centreon整合运行!
  Linux Platform: CentOS 6.5 x86_64

  

  Note: you should config postfix mail running correctly first.
  please setup NTP for time synchronization
  

  1. 安装所需包
  rpm -ivh http://mirrors.sohu.com/fedora-epel/6Server/x86_64/epel-release-6-8.noarch.rpm

  yum update
  
yum -y install httpd gd fontconfig-devel libjpeg-devel libpng-devel gd-devel perl-GD openssl-devel perl-DBD-MySQL mysql-server mysql-devel php php-mysql php-gd php-ldap php-xml php-mbstring perl-Config-IniFiles perl-DBI perl-DBD-MySQL rrdtool perl-rrdtool perl-Crypt-DES perl-Digest-SHA1 perl-Digest-HMAC net-snmp-utils perl-Socket6 perl-IO-Socket-INET6 net-snmp net-snmp-libs php-snmp dmidecode lm_sensors perl-Net-SNMP net-snmp-perl fping cpp gcc gcc-c++ libstdc++ glib2-devel php-pear
  

  

  usermod -U apache
pear channel-update pear.php.net
pear upgrade-all
  

  2. vi /etc/my.cnf

  在[mysqld] 加入

  default-storage-engine=INNODB
  innodb_file_per_table=1
  

  3. 安装Nagios 3,Nagios Plugins and NRPE plugins
参考 http://hj192837.blog.运维网.com/655995/1130072

  

  4. 安装ndoutils
  tar zxf ndoutils-1.5.2.tar.gz

  cd ndoutils-1.5.2/
./configure
make && make install
cp daemon-init /etc/init.d/ndo2db
chmod 755 /etc/init.d/ndo2db
chkconfig --add ndo2db
cp config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
cp config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
chown nagios.nagios /usr/local/nagios/etc/ndo*
chmod 664 /usr/local/nagios/etc/ndo*
  

  5. service nagios start
service httpd start
  chkconfig --level 35 httpd on
  service mysqld start
  chkconfig --level 35 mysqld on
service ndo2db start
  

  6. 安装centreon 2.4.5
  tar zxf centreon-2.4.5.tar.gz
  cd centreon-2.4.5
  ./install.sh -i
  

  进入文本安装
  You will now read Centreon Licence.
Press enter to continue.
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]
>
  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]
>
  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 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]
>/usr/local/centreon/var/lib
  Do you want me to create this directory ? [/usr/local/centreon/var/lib]
[y/n], default to [n]:
> y
Path /usr/local/centreon/var/lib              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/lib64/perl5/RRDs.pm#针对64位系统
Path /usr/lib/perl5                    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]
>
  What is the Centreon user ? [centreon]
default to [centreon]
>
  What is the Monitoring engine user ?
> nagios
  What is the Broker user ? (optional)
> nagios
  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
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
  ------------------------------------------------------------------------
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 has been configured previously
  Do you want me to reconfigure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo                      OK
  ------------------------------------------------------------------------
Configure Apache server
------------------------------------------------------------------------
Finding Apache Centreon configuration file
'/etc/httpd/conf.d/centreon.conf' :            OK
  Do you want to update Centreon Apache sub configuration file ?
[y/n], default to [n]:
> y
Backup Centreon Apache configuration completed
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 right on /usr/local/nagios/etc           OK
Add group nagios to user apache              OK
Add group nagios to user nagios              OK
Add group centreon to user nagios             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 eventReportBuilder.pl          OK
Change macros for dashboardBuilder.pl           OK
Install cron directory                   OK
Change right for eventReportBuilder.pl           OK
Change right for dashboardBuilder.pl            OK
Change macros for centreon.logrotate            OK
Install Centreon logrotate.d file             OK
Prepare export-mysql-indexes                OK
Install export-mysql-indexes                OK
Prepare import-mysql-indexes                OK
Install import-mysql-indexes                OK
Prepare indexes schema                   OK
Install indexes schema                   OK
  ------------------------------------------------------------------------
Pear Modules
------------------------------------------------------------------------
Check PEAR modules
PEAR              1.4.9    1.9.4     OK
DB               1.7.6    1.7.14     OK
DB_DataObject          1.8.4    1.11.2     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
HTML_Common           1.2.2    1.2.5     OK
HTML_QuickForm         3.2.5    3.2.13     OK
HTML_QuickForm_advmultiselect  1.1.0    1.5.1     OK
HTML_Table           1.6.1    1.8.3     OK
Archive_Tar           1.1     1.3.11     OK
Auth_SASL            1.0.1    1.0.6     OK
Console_Getopt         1.2     1.3.1     OK
Net_SMTP            1.2.8    1.6.1     OK
Net_Socket           1.0.1    1.0.10     OK
Net_Traceroute         0.21    0.21.3     OK
Net_Ping            2.4.1    2.4.5     OK
Validate            0.6.2    0.8.5     OK
XML_RPC             1.4.5    1.5.5     OK
SOAP              0.10.1   0.13.0     OK
Log               1.9.11   1.12.7     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
  ------------------------------------------------------------------------
Start CentStorage Installation
------------------------------------------------------------------------
  Where is your Centreon Run Dir directory?
default to [/var/run/centreon]
>/usr/local/centreon/var/run
  Do you want me to create this directory ? [/usr/local/centreon/var/run]
[y/n], default to [n]:
> y
Path /usr/local/centreon/var/run              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]
>/usr/local/centreon/var/lib
Path /usr/local/centreon/var/lib              OK
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
install www/install/createTablesCentstorage.sql      OK
Creating Centreon Directory '/usr/local/centreon/var/lib/stOKus'
Creating Centreon Directory '/usr/local/centreon/var/lib/meOKics'
Change macros for centstorage binary            OK
Install CentStorage binary                 OK
Install library for centstorage              OK
Change right : /usr/local/centreon/var/run         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 logAnalyser-cbroker           OK
Install logAnalyser-cbroker                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
Change macros for centstorage.logrotate          OK
Install Centreon Storage logrotate.d file         OK
Create /usr/local/centreon/etc/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
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change CentCore Macro                   OK
Copy CentCore in binary directory             OK
Change right : /usr/local/centreon/var/run         OK
Change right : /usr/local/centreon/var/lib         OK
Change macros for centcore.logrotate            OK
Install Centreon Core logrotate.d file           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 /usr/local/centreon/etc/instCentCore.conf      OK
  ------------------------------------------------------------------------
Start CentPlugins Installation
------------------------------------------------------------------------
  Where is your CentPlugins lib directory
default to [/var/lib/centreon/centplugins]
> /usr/local/centreon/var/lib/centplugins/
  Do you want me to create this directory ? [/usr/local/centreon/var/lib/centplugins/]
[y/n], default to [n]:
> y
Path /usr/local/centreon/var/lib/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
  ------------------------------------------------------------------------
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 Apache user :                   apache
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved...
Change macros for CentPluginsTraps             OK
Change macros for init scripts               OK
Installing the plugins Trap binaries            OK
Change macros for snmptrapd.conf              OK
Change macros for snmptt.ini                OK
SNMPTT init script installed                OK
Install : snmptrapd.conf                  OK
Install : snmp.conf                    OK
Install : snmptt.ini                    OK
Install : snmptt                      OK
Install : snmptthandler                  OK
Install : snmpttconvertmib                 OK
Create /usr/local/centreon/etc/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              #
#                                       #
###############################################################################
  

  进入Web安装 -- http://localhost/centreon

  (1)centreon的欢迎界面


  (2)检查依赖关系

  (3)配置nagios信息

  (4)配置ndoutils模块

  (5)配置admin用户

  (6)配置数据库信息

  这里设置Database user password为centreon
  (7)安装

  (8)安装完成

  

  登录错误信息

  解决方法:
  mysql -u root
mysql> grant all on centreon.* to centreon@localhost identified by 'centreon';
mysql> grant all on centreon_status.* to centreon@localhost identified by 'centreon';
mysql> grant all on centreon_storage.* to centreon@localhost identified by 'centreon';
mysql> flush privileges;
  

  成功页面如下

  检查重新生成配置文件

  

  service ndo2db restart
  


  查看nagios相关日志
  tail  /usr/local/nagios/var/nagios.log | grep ndomod
  [1387287820] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1387287820] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
  

  Note: tail  /usr/local/nagios/var/nagios.log | perl -pe 's/(\d+)/localtime($1)/e'| grep ndomod 可查看huamn readable的时间显示

  

  检查localhost是否up

  

  For usage of SNMP and SNMP traps:
  service snmpd start
  service snmptrapd start
  service snmptt start
  chkconfig --level 35 snmpd on
  chkconfig --level 35 snmptrapd on
  chkconfig --level 35 snmptt on
  

  it's done!!!

  

  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-663069-1-1.html 上篇帖子: nagios 监控linux 网卡 下篇帖子: Nagios 开源的免费网络监视工具
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表