Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244036
  • 博文数量: 38
  • 博客积分: 517
  • 博客等级: 下士
  • 技术积分: 419
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-07 09:05
文章分类

全部博文(38)

文章存档

2018年(1)

2015年(1)

2014年(4)

2013年(11)

2012年(4)

2011年(17)

分类: LINUX

2014-02-24 17:25:41

环境 redhat5.8 centreon-2.2.0 rrdtool-1.4.5 nagios-3.2.1 nagios-plugins-1.4.14

安装前准备
1 关闭selinux
2 关闭iptables
3 建立lamp环境
4 创建数据库 nagios 建立用户nagios 并授权

nagios 安装
useradd nagios
usermod -G nagios apache 
tar -zxvf nagios-3.2.3.tar.gz  
cd nagios-3.2.3
./configure --prefix=/usr/local/nagios --with-gd-lib --with-gd-inc  
make all  
make install  
make install-init 生成启动文件
make install-commandmode   设置组的执行权限
make install-config 生成配置文件

插件安装
tar -zxvf nagios-plugins-1.4.15.tar.gz  
cd nagios-plugins-1.4.15
./configure --prefix=/usr/local/nagios-plugins 
make all  
make install
cp -fa /usr/local/nagios-plugins/libexec/* /usr/local/nagios/libexec/ 
 
vi /etc/httpd/conf/httpd.conf

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin


Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user


Alias /nagios /usr/local/nagios/share


Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user


htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin 建立用户设置密码
 

安装ndoutils
wget
或者 ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/DBD/

./configure --enable-mysql  --with-mysql=/data/mysql/
make
# 我的Nagios是3.0.5,所以拷贝的是ndomod-3x.o、ndo2db-3x,如果你的是2.X.x请拷贝ndomod-2x.o、ndo2db-2x
cp ndomod-3x.o ndo2db-3x log2ndo file2sock /usr/local/nagios/bin
cd ../db
./installdb -u root -p 123456 -d nagios(这需要改下installdb脚本,指定mysql的可执行程序在哪,否则报不能发现mysql命令在哪
.)
# 拷贝配置文件
cd ../config
cp ndo* /usr/local/nagios/etc/
# 修改/usr/local/nagios/etc/ndo2db.cfg文件的数据库信息。
vi /usr/local/nagios/etc/ndo2db.cfg
vi nagios.cfg
# 复制下面内容粘贴到/usr/local/nagios/etc/nagios.cfg配置文件的#broker_module=...下面。
# Uncomment the line below if you're running Nagios 3.x
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
# 修改/usr/local/nagios/etc/nagios.cfg配置文件下面参数的值为-1(一般默认如此)。
event_broker_options=-1
# 启动ndo2db
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg

安装rrdtool
tar -zxvf rrdtool-1.4.5.tar.gz
cd rrdtool-1.4.5
./configure --prefix=/usr/local/rrdtool && make && make install


安装CENTREON
 ./install.sh –i

一路y下去

中间需要修改的地方
1
Where is the RRD perl module installed [RRDs.pm]
default to [/usr/lib/perl5/RRDs.pm]
>/usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/RRDs.pm

2
Where is rrdtool
default to [/usr/bin/rrdtool]
> /usr/local/rrdtool/bin/rrdtool

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

4
Where is your NDO ndomod binary ?
default to [/usr/sbin/ndomod.o]
> /usr/local/nagios/bin/ndomod-3x.o


Configure Apache server
这一步。必须都是ok
如果有失败
rm -rf /usr/local/centreon
rm -rf /etc/centreon
rm -rf /etc/httpd/conf.d/centreon.conf
rm -rf /var/lib/centreon
然后
./install.sh -i


Pear Modules
这一步也必须是ok
否则程序会自动给你安装,自动安装需要主机能联网
否则你只能自己手动安装了

Installing PEAR modules
Check PEAR modules
PEAR                            1.4.9       1.4.9          OK
DB                              1.7.6       1.7.6          OK
DB_DataObject                   1.8.4       1.8.4          OK
DB_DataObject_FormBuilder       1.0.0RC4    1.0.0RC4       OK
MDB2                            2.0.0       2.0.0          OK
Date                            1.4.6       1.4.6          OK
HTML_Common                     1.2.2       1.2.2          OK
HTML_QuickForm                  3.2.5       3.2.5          OK
HTML_QuickForm_advmultiselect   1.1.0       1.1.0          OK
HTML_Table                      1.6.1       1.6.1          OK
Archive_Tar                     1.1         1.3.1          OK
Auth_SASL                       1.0.1       1.0.1          OK
Console_Getopt                  1.2         1.2            OK
Net_SMTP                        1.2.8       1.2.8          OK
Net_Socket                      1.0.1       1.0.1          OK
Net_Traceroute                  0.21        0.21           OK
Net_Ping                        2.4.1       2.4.1          OK
Validate                        0.6.2       0.6.2          OK
XML_RPC                         1.4.5       1.5.0          OK
SOAP                            0.10.1      0.10.1         OK
Log                             1.9.11      1.9.11         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
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 : #
#                            to finish the setup                              #
#                                                                             #
#                  Report bugs at #
#                                                                             #
#                         Thanks for using Centreon.                          #
#                          -----------------------                            #
#                        Contact : infos@centreon.com                         #
#                          #
#                                                                             #
###############################################################################


到这里centreon就安装完成。

阅读(2634) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~