不帅 发表于 2015-1-14 20:41:48

给大家带来Centos6.5下装置Nagios4.02+Centreon-2.5.0

如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!1、体系情况:
Centos6.5x64
Nagios4.0.2
Centreon-2.5.0.tar
nrpe-2.15
ndoutils-1.5.2.tar.gz
--------------------
2、下载软件包:
http://sourceforge.net/projects/nagios/files/?source=navbar



#cd/usr/local/src/
#ls

#wgethttp://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.2/nagios-4.0.2.tar.gz
#wgethttp://assets.nagios.com/downloads/nagiosplugins/nagios-plugins-1.5.tar.gz
#wgethttp://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
#wgethttp://nchc.dl.sourceforge.net/project/nagios/ndoutils-1.x/ndoutils-1.5.2/ndoutils-1.5.2.tar.gz
#wgethttp://download.centreon.com/centreon/centreon-2.5.0.tar.gz
3、更新yum源,装置centreon所必要的情况
必要增加RPMforge材料库
#wgethttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
lianglabsrc]#wgethttp://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

#rpm--importRPM-GPG-KEY.dag.txt
#rpm-ivhrpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Preparing...###########################################
1:rpmforge-release###########################################
#
如今你要做好装置前的筹办。
#yumupdate
#yumupgrade


装置依附包和Apache办事器
2.装置GD库相干
#yuminstallgdfontconfig-devellibjpeg-devellibpng-develgd-develperl-GD

3.装置mysql库相干
#yum-yinstallopenssl-develperl-DBD-MySQLmysql-servermysql-devel

4.装置PHP及扩大
#yum-yinstallphpphp-mysqlphp-gdphp-ldapphp-xmlphp-mbstring

5.装置PERL及扩大模块
#yum-yinstallperl-DBIperl-DBD-MySQL
#yum-yinstallperl-Config-IniFiles

6.装置RRDTools相干
#yum-yinstallrrdtoolperl-rrdtool

7.装置SNMP相干
#yum-yinstallperl-Crypt-DESperl-Digest-SHA1perl-Digest-HMACnet-snmp-utils
#yum-yinstallperl-Socket6perl-IO-Socket-INET6net-snmpnet-snmp-libsphp-snmpdmidecodelm_sensorsperl-Net-SNMPnet-snmp-perl

8.装置其他相干依附库
#yum-yinstallfpingcppgccgcc-c++libstdc++glib2-devel
#yum-yinstallfping
#yum-yinstallphp-processphp-devel
9.装置PEAR相干
#yum-yinstallphp-pearphp-pear-DB
#pearchannel-updatepear.php.net
#pearchannel-updatepear.php.net
Nologhandlingenabled-turningonstderrlogging
Createddirectory:/var/lib/net-snmp/mib_indexes
Updatingchannel"pear.php.net"
UpdateofChannel"pear.php.net"succeeded
#

#pearupgrade-all

#pearupgrade-all
Willupgradechannel://pear.php.net/xml_rpc
Willupgradechannel://pear.php.net/archive_tar
Willupgradechannel://pear.php.net/console_getopt
WARNING:"pear/XML_RPC"isdeprecatedinfavorof"pear/XML_RPC2"
WARNING:"pear/Console_Getopt"isdeprecatedinfavorof"pear/Console_GetoptPlus"
downloadingXML_RPC-1.5.5.tgz...
StartingtodownloadXML_RPC-1.5.5.tgz(31,862bytes)
.........done:31,862bytes
downloadingArchive_Tar-1.3.11.tgz...
StartingtodownloadArchive_Tar-1.3.11.tgz(18,537bytes)
...done:18,537bytes
downloadingConsole_Getopt-1.3.1.tgz...
StartingtodownloadConsole_Getopt-1.3.1.tgz(4,471bytes)
...done:4,471bytes
upgrade-allok:channel://pear.php.net/XML_RPC-1.5.5
upgrade-allok:channel://pear.php.net/Archive_Tar-1.3.11
upgrade-allok:channel://pear.php.net/Console_Getopt-1.3.1
#

10.反省基本包是不是全体装置乐成
#rpm-qgdfontconfig-devellibjpeg-devellibpng-develgd-develperl-GD|grep"notinstalled"
packagelibjpeg-develisnotinstalled

#rpm-qopenssl-develperl-DBD-MySQLmysql-servermysql-devel|grep"notinstalled"
#rpm-qphpphp-mysqlphp-gdphp-ldapphp-xmlphp-mbstring|grep"notinstalled"
#rpm-qperl-DBIperl-DBD-MySQL|grep"notinstalled"
#rpm-qperl-Config-IniFiles|grep"notinstalled"
#rpm-qrrdtoolperl-rrdtool|grep"notinstalled"
packageperl-rrdtoolisnotinstalled===============rrdtool-perl-1.3.8-6.el6.x86_64alreadyinstalled
#rpm-qperl-Crypt-DESperl-Digest-SHA1perl-Digest-HMACnet-snmp-utils|grep"notinstalled"
#rpm-qperl-Socket6perl-IO-Socket-INET6net-snmpnet-snmp-libsphp-snmpdmidecodelm_sensors#perl-Net-SNMPnet-snmp-perl|grep"notinstalled"
perl-Socket6-0.23-4.el6.x86_64
perl-IO-Socket-INET6-2.56-4.el6.noarch
net-snmp-5.5-49.el6.x86_64
net-snmp-libs-5.5-49.el6.x86_64
php-snmp-5.3.3-27.el6_5.x86_64
dmidecode-2.11-2.el6.x86_64
lm_sensors-3.1.1-17.el6.x86_64
#rpm-qfpingcppgccgcc-c++libstdc++glib2-devel|grep"notinstalled"
#rpm-qphp-pearphp-pear-DB|grep"notinstalled"
packagephp-pear-DBisnotinstalled--========,php-pear-db-1.7.13-2.el6.rf.noarchalreadyinstalled
#






====================装置nagios=====================
1.创立相干用户及用户组
#/usr/sbin/useradd-u288nagios
#/usr/sbin/groupadd-g289nagcmd
#/usr/sbin/usermod-Gnagios,nagcmdapache
#tarzxvfnagios-4.0.2.tar.gz




指定装置目次和账号相干
#cdnagios-4.0.2
#./configure--prefix=/usr/local/nagios--with-command-group=nagcmd--enable-nanosleep--enable-broker


#makeall

#makeinstall

主动装置启动剧本和web相干
#makeinstall-init
#makeinstall-commandmode

#makeinstall-config

#makeinstall-webconf






三.装置nagios-plugins插件
#cd/usr/local/src/
#tarzxvfnagios-plugins-1.5.tar.gz


#cdnagios-plugins-1.5
#

#./configure--with-nagios-user=nagios--with-nagios-group=nagios--with-openssl=/usr/bin/openssl--enable-perl-modules
#makeall
#makeinstall



设定web上岸暗码
#htpasswd-c/usr/local/nagios/etc/htpasswd.usersnagiosadmin
Newpassword:
Re-typenewpassword:
Addingpasswordforusernagiosadmin

#cat/usr/local/nagios/etc/htpasswd.users
nagiosadmin:laowU8TvgioQA

开机主动启动相干办事
#chkconfig--addnagios
#chkconfighttpdon
#chkconfigmysqldon
启动mysql
#/etc/init.d/mysqldrestart

设置mysql的暗码
#/usr/bin/mysqladmin-urootpasswordliang123
#


反省nagios设置文件
#/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg





#/etc/init.d/httpdrestart
中断httpd:[失利]
正在启动httpd:
[断定]
#
#
#/etc/init.d/nagiosrestart
中断nagios:[失利]
正在启动nagios:[断定]

#cat/usr/local/nagios/var/nagios.log
Nagios4.0.2starting...(PID=10532)
LocaltimeisWedJan1516:49:57CST2014
LOGVERSION:2.0
qh:Socket/usr/local/nagios/var/rw/nagios.qhsuccessfullyinitialized
qh:corequeryhandlerregistered
nerd:Channelhostchecksregisteredsuccessfully
nerd:Channelservicechecksregisteredsuccessfully
nerd:Channelopathchecksregisteredsuccessfully
nerd:Fullyinitializedandreadytorock!
wproc:Successfullyregisteredmanageras@wprocwithqueryhandler
wproc:Registryrequest:name=CoreWorker10537;pid=10537
wproc:Registryrequest:name=CoreWorker10536;pid=10536
wproc:Registryrequest:name=CoreWorker10535;pid=10535
wproc:Registryrequest:name=CoreWorker10534;pid=10534
Successfullylaunchedcommandfileworkerwithpid10538
SERVICEALERT:localhost;HTTP;WARNING;SOFT;1;HTTPWARNING:HTTP/1.1403Forbidden-5237bytesin0.001secondresponsetime
SERVICEALERT:localhost;HTTP;WARNING;SOFT;2;HTTPWARNING:HTTP/1.1403Forbidden-5237bytesin0.000secondresponsetime
SERVICEALERT:localhost;HTTP;WARNING;SOFT;3;HTTPWARNING:HTTP/1.1403Forbidden-5237bytesin0.000secondresponsetime
SERVICEALERT:localhost;HTTP;WARNING;HARD;4;HTTPWARNING:HTTP/1.1403Forbidden-5237bytesin0.001secondresponsetime
#






修正数据库文件
#vi/etc/my.cnf
增加一行设置
innodb_file_per_table=1
四.装置nrpe扩大组件
#cd/usr/local/src/
#tarzxvfnrpe-2.15.tar.gz

#cdnrpe-2.15
#./configure



(1)装置check_nrpe这个插件
#makeall
#makeinstall-plugin

(2)装置deamon
#makeinstall-daemon

(3)装置设置文件
#makeinstall-daemon-config

(4)编纂nrpe设置文件
lianglabnrpe-2.15]#vim/usr/local/nagios/etc/nrpe.cfg
默许为allowed_hosts=127.0.0.1修正为allowed_hosts=127.0.0.110.1.10.132


5)启动nrpe
#/usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe.cfg-d
#

6)检察NRPE是不是已启动
<divstyle="padding:0px;margin:0px;color:#2c2c2c;font-size:14.44444465637207px;background-color:#ffffff;font-family:microsoftyaheiui,microsoftyahei,simsun,segoeui,tahoma,helvetica,sans-serif,microsoftyahei,georgia,helvetica,arial,sans-serif,宋体,pmingliu,serif;line-height:23.33333396911621px;">#netstat-nltp|grepnrpe

再见西城 发表于 2015-1-16 21:32:50

给大家带来Centos6.5下装置Nagios4.02+Centreon-2.5.0

众所周知,目前windows操作系统是主流,在以后相当长的时间内不会有太大的改变,其方便友好的图形界面吸引了众多的用户。

兰色精灵 发表于 2015-1-16 21:32:50

给大家带来Centos6.5下装置Nagios4.02+Centreon-2.5.0

了解Linux的网络安全,系统的安全,用户的安全等。安全对于每位用户,管理员来说是非常重要的。

不帅 发表于 2015-1-16 21:32:50

给大家带来Centos6.5下装置Nagios4.02+Centreon-2.5.0

Linux简单,占内存少,特别是对于程序开发人员来说很方便,如果说windows的成功在于其方便用户的窗口管理界面。

海妖 发表于 2015-1-25 23:15:03

学习Linux,应该怎样学,主要学些什么,一位Linux热心学习者,一段学习Linux的风云经验,历时十二个小时的思考总结,近十位网络Linux学习者权威肯定,为您学习Linux指明方向。

小魔女 发表于 2015-2-4 17:45:00

尽我能力帮助他人,在帮助他人的同时你会深刻巩固知识。

蒙在股里 发表于 2015-3-1 01:16:55

如果你想深入学习Linux,看不懂因为文档实在是太难了。写的最好的、最全面的文档都是英语写的,最先发布的技术信息也都是用英语写的。

谁可相欹 发表于 2015-3-10 12:58:25

其实老师让写心得我也没怎么找资料应付,自己想到什么就写些什么,所以不免有些凌乱;很少提到编程,因为那些在实验报告里已经说了,这里再写就多余了。

爱飞 发表于 2015-3-17 09:10:17

和私有操作系统不同,各个Linux的发行版本的技术支持时间都较短,这对于Linux初学者是往往不够的。

第二个灵魂 发表于 2015-3-24 06:08:33

如果上面的措施没有解决问题,此时你就需要Linux社区的帮助了。 Linux的使用者一般都是专业人士,他们有着很好的电脑背景且愿意协助他人。
页: [1]
查看完整版本: 给大家带来Centos6.5下装置Nagios4.02+Centreon-2.5.0