|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!本文先容完全的nagios和centreon装置历程。
装置情况:
CentOS5.6,X64updated。
MonitorEngine:Nagios
Brokermodule:NDoutils
假定:
已装置并启动mysql
路径为:/usr/local/mysql/
sock路径:/var/lib/mysql/mysql.sock
步调参考英文原文:http://documentation.centreon.com/docs/centreon/en/latest/installation/from_sources.html
1、下载装置包
#下载nagios、nagios-plugin、nrpe、ndoutils和ndoutils的一个patch
cd/data/tool
[code][/code]
#在http://www.centreon.com/Content-Products-IT-network-monitoring/supported-software-and-requirements反省装置centreon所必要的软件包
#下载centreon2.4.0
wgethttp://download.centreon.com/index.php?id=4264
#装置一些需要的package
yuminstall-ywgethttpdphpgccglibcglibc-commongdgd-develmakenet-snmp
2、入手下手装置nagios
#创建用户和组
chattr-i/etc/passwd/etc/shadow/etc/group/etc/gshadow
useraddnagios
groupaddnagcmd
usermod-a-Gnagcmdnagios
usermod-a-Gnagcmdapache
#装置nagios-core
tar-zxvfnagios-3.5.1.tar.gz
cdnagios
./configure--prefix=/usr/local/nagios--with-command-group=nagcmd
--enable-event-broker--enable-embedded-perl--with-perlcache
makeall
makeinstall
makeinstall-init
makeinstall-config
makeinstall-commandmode
makeinstall-webconf
cp-Rcontrib/eventhandlers//usr/local/nagios/libexec/
chown-Rnagios:nagios/usr/local/nagios/libexec/eventhandlers
#启动nagiosapache
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagiosstart
/etc/init.d/httpdstart
#创立nagios用户用于登录
htpasswd-c/usr/local/nagios/etc/htpasswd.usersnagiosadmin
#装置nagios-plugins
tar-zxvfnagios-plugins-1.5.tar.gz
cd../nagios-plugins-1.5
./configure--with-nagios-user=nagios
--with-nagios-group=nagios
--prefix=/usr/local/nagios
--enable-redhat-pthread-workaround--with-ipv6=no
--enable-perl-modules
--with-mysql=/usr/local/mysql
make&&makeinstall
#装置nrpe
tar-zxvfnrpe-2.15.tar.gz
./configure--prefix=/usr/local/nagios
makeall
makeinstall-plugin
makeinstall-daemon
makeinstall-daemon-config
makeinstall-xinetd
装置xinetd以便办理
yuminstallxinetd-y
sed-is/127.0.0.1/127.0.0.1183.61.70.34//etc/xinetd.d/nrpe
sed-i578i
rpe5666/tcp#NRPE/etc/services
servicexinetdrestart
/usr/local/nagios/libexec/check_nrpe-Hlocalhost-ccheck_users
sed-is/allowed_hosts=127.0.0.1/allowed_hosts=127.0.0.1,<youripaddr>//usr/local/nagios/etc/nrpe.cfg
3、装置ndoutils
tar-zxvfndoutils-1.5.2.tar.gz
cdndoutils-1.5.2
patch-p1-N<../ndoutils1.5.2_light.patch
./configure--prefix=/usr/local/nagios/--enable-mysql--with-mysql=/usr/local/mysql--with-ndo2db-user=nagios--with-ndo2db-group=nagios
默许的源文件make会报错修正以下
sed-i-es/#include<mysql/mysql.h>/#include</usr/local/mysql/include/mysql.h>/include/config.h
sed-i-es/#include<mysql/errmsg.h>/#include</usr/local/mysql/include/errmsg.h>/include/config.h
make
makeinstall
cp./config/ndo2db.cfg-sample/usr/local/nagios/etc/ndo2db.cfg
cp./config/ndomod.cfg-sample/usr/local/nagios/etc/ndomod.cfg
#编纂/usr/local/nagios/etc/nagios.cfg在broker_module处增加
broker_module=/usr/local/nagios/bin/ndomod-3x.oconfig_file=/usr/local/nagios/etc/ndomod.cfg
#装置启动文件
chmod+xdaemon-init
cpdaemon-init/etc/init.d/ndo2db
#创立数据库用户
mysql-p
>>createdatabasenagios;
GRANTALLPRIVILEGESONnagios.*TOnagios@localhostIDENTIFIEDBYnagios;
>>FLUSHPRIVILEGES;
#装置数据库
cddb/
./installdb-unagios-pnagios-hlocalhost-dnagios
4、装置centreon
usermod-a-Gapachecentreon
usermod-a-Gnagioscentreon
wgethttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
wgethttp://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm--importRPM-GPG-KEY.dag.txt
rpm-ivhrpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
yumcleanall
yumupdate
yumupgrade
yuminstallhttpdgdfontconfig-devellibjpeg-devellibpng-develgd-develperl-GD
openssl-develperl-DBD-MySQLmysql-servermysql-develphpphp-mysqlphp-gdphp-ldapphp-xmlphp-mbstring
perl-Config-IniFilesperl-DBIperl-DBD-MySQLrrdtoolperl-rrdtoolperl-Crypt-DESperl-Digest-SHA1
perl-Digest-HMACnet-snmp-utilsperl-Socket6perl-IO-Socket-INET6net-snmpnet-snmp-libsphp-snmp
dmidecodelm_sensorsperl-Net-SNMPnet-snmp-perlfpingcppgccgcc-c++libstdc++glib2-devel
php-pear
usermod-Uapache
pearchannel-updatepear.php.net
peardevupgrade-all
pearupgrade-all
报错处置:[PHPFatalerror:Allowedmemorysizeof8388608bytesexhausted]
echomemory_limit=256M>>/etc/php.ini
#入手下手装置centreon
./install.sh-i
#经由一系列回车(坚持默许设置)和必要填写的路径完成下令行下的centreon装置。
#此处纷歧一贴出
#必要注重的两个路径RRDs.pm、PEAR.php可以使用find找到正确路径
/usr/local/rrdtool/lib/perl/5.8.8/x86_64-linux-thread-multi/RRDs.pm
/usr/share/pear/PEAR.php
#设置centreon数据库用户
GRANTALLPRIVILEGESON`centreon`.*TOcentreon@localhostidentifiedbycentreon;
GRANTALLPRIVILEGESON`centreon_storage`.*TOcentreon@localhostidentifiedbycentreon;
GRANTALLPRIVILEGESON`centreon_status`.*TOcentreon@localhostidentifiedbycentreon;
FLUSHPRIVILEGES;
#登录web界面举行下一步装置:
http://SERVER_ADDRESS/centreon
#反省php拓展
#设置Nagios相干路径
#设置NDoutils路径
#***账户暗码
#数据库毗连信息
#入手下手装置数据库
#装置完成可登录
以上为centreon装置完全步调,坑略微有点多。
出格是centreon下令行形式装置时每一个路径、文件名都不要写错。
欢迎大家来到仓酷云论坛! |
|