centos 6安装smokeping.docx_第1页
centos 6安装smokeping.docx_第2页
centos 6安装smokeping.docx_第3页
centos 6安装smokeping.docx_第4页
centos 6安装smokeping.docx_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

前言:由于近段时间一直有网友在网上问关于在smokeping在centos6.2下面的安装问题,主要的问题是centos6.2默认安装的是perl 5.10.1,而centos5默认安装的是perl 5.8.8,所以如果在在centos6.2下直接按centos5的安装方法的话总会有一些奇怪的问题,归根到底还是要解决perl的问题。我趁这几天有时间,就在网上参考了几个网友的文章,再参照我以前写的centos5.6的安装教程,综合起来,终于成功在centos6.2上安装smokeping!话不多说!直接上效果图:系统环境图一、初始化安装centos6.2这里不用多说了,选择最小化安装即可!确保系统有安装了yum工具和网络能通就可以!二、准备工作1、请先暂时关闭iptables以及selinux刨除其他影响1)关闭selinuxvi /etc/sysconfig/selinux 将 SELINUX=enforcing改成 SELINUX=disabled 重启系统后生效2)关闭防火墙; service iptables stop注:重启系统后默认是开启防火墙的2、更新一下yum源,国内用163的吧。 cd /etc/yum.repos.d/wget /.help/CentOS6-Base-163.repoyum clean all #清除缓存yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度三、安装apache与smokeping1、首先安装web服务器,我选用apacheyum install httpdyum install httpd-devel2、安装rrdtool1)rrdtool所依赖的库yum -y install libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-develyum install -y httpd perl-Compress-Zlib perl-HTML-Tagset perl-HTML-Parser perl-libwww-perl xorg-x11-fonts-Type1 ruby libdbiyum -y install fonts-chinese.noarchyum install rrdtool-perl2)rrdtool的具体安装(建议不要用yum安装,用tar安装可以指定相应的路径,方便后续查找路径使用)(1)wget http:/oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz (2)tar -zxvf rrdtool-1.4.5.tar.gz (3)cd rrdtool-1.4.5(4)./configure -prefix=/usr/local/rrdtool -disable-tcl -disable-python出现错误:rootlocalhost rrdtool-1.4.5# ./configure -prefix=/usr/local/rrdtool -disable-tcl -disable-pythonchecking build system type. i686-pc-linux-gnuchecking host system type. i686-pc-linux-gnuchecking target system type. i686-pc-linux-gnuchecking for gcc. nochecking for cc. nochecking for cl.exe. noconfigure: error: in /root/rrdtool-1.4.5:configure: error: no acceptable C compiler found in $PATHSee config.log for more details./提示系统没有安装gcc等编译工具解决方法:(用tar安装软件,提示缺少什么,那你就直接安装什么就行了!)yum -y install gcc安装成功gcc后,再接着上面的步骤继续走!(5)make & make install出现错误1:-bash: make: command not found解决方法:yum -y install make出现错误2:Cant locate ExtUtils/MakeMaker.pm in INC (INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at Makefile.PL line 1.BEGIN failed-compilation aborted at Makefile.PL line 1.make3: * perl-piped/Makefile Error 2make3: Leaving directory /root/rrdtool-1.4.5/bindingsmake2: * all-recursive Error 1make2: Leaving directory /root/rrdtool-1.4.5/bindingsmake1: * all-recursive Error 1make1: Leaving directory /root/rrdtool-1.4.5make: * all Error 2解决方法:yum install perl-ExtUtils-MakeMakeryum install perl-Time-HiRes再次执行make & make install顺利完成!(6).RRDTOOL安装后验证/usr/local/rrdtool/bin/rrdtool -v出现以下RRDTOOL的信息就已经成功了rootlocalhost rrdtool-1.4.5# /usr/local/rrdtool/bin/rrdtool -vRRDtool 1.4.5 Copyright 1997-2010 by Tobias Oetiker Compiled May 19 2012 06:02:55Usage: rrdtool options command command_optionsValid commands: create, update, updatev, graph, graphv, dump, restore,last, lastupdate, first, info, fetch, tune,resize, xport, flushcachedRRDtool is distributed under the Terms of the GNU GeneralPublic License Version 2. (/copyleft/gpl.html)For more information read the RRD manpages切忌,安装完一定要验证,不一定安装完成后就是成功的。3、Smokeping安装下面安装cgilib、fping、echoping 1)安装cgilib(1)wget /distfiles/cgilib-0.5.tar.gz(2)tar zxvf cgilib-0.5.tar.gz(3) cd cgilib-0.5(40 make(5)cp libcgi.a /usr/local/lib(6)cp cgi.h /usr/include 2)安装fping-2.4b2_to(1)wget /download/fping.tar.gz(2)tar zxvf fping.tar.gz(3)cd fping-2.4b2_to(4)./configure(5)make(6)make check(7)make install(8)whereis fpingfping: /usr/local/sbin/fping/查看fping的安装路径,方便后续填写路径!3)安装echoping(1)wget /project/echoping/echoping/6.0.0/echoping-6.0.0.tar.gz(2)tar zxvf echoping-6.0.0.tar.gz (3)cd echoping-6.0.0(4)./configure -without-libidn遇到错误:checking for poptGetContext. no解决办法:首先:编译popt-1.7时,出现如下错误checking for GNU gettext. configure: error:* GNU gettext is required. The latest version* is always available from /gnu/gettext/./提示缺少gettext然后安装gettextwget /gnu/gettext/gettext-0.18.tar.gztar xzvf gettext-0.18.tar.gz ./configuremakemake install再回来安装poptcd popt-1.7./configuremakemake install如有报错checking for GNU gettext. configure: error:* GNU gettext is required. The latest version* is always available from /gnu/gettext/. 检查是不是版本冲突,解决办法yum remove gettext最后再继续安装echopingcd echoping-6.0.0./configure -without-libidn(5)make(6)make test完全解决echoping安装问题,遇到测试不成功等信息就 ctrl+c 回到命令行;(7) whereis echopingechoping: /usr/local/bin/echoping /usr/local/lib/echoping4)安装FCGI(1)wget /authors/id/F/FL/FLORA/FCGI-0.74.tar.gz(2)tar zxvf FCGI-0.74.tar.gz (3)cd FCGI-0.74(4)perl Makefile.PL (5)make & make install5)mod_fastcgi(1)wget /dist/mod_fastcgi-2.4.6.tar.gz(2)tar zxvf mod_fastcgi-2.4.6.tar.gz(3)cd mod_fastcgi-2.4.6(4)/usr/local/apache2/bin/apxs -o mod_fastcgi.so -c *.c(5)/usr/local/apache2/bin/apxs -i -a -n fastcgi .libs/mod_fastcgi.so遇到问题:发现找不到apxs 解决:yum install httpd-devel(如果系统原来已安装httpd-devel,则不会出现这个报错)(6)修改apache配置文件 :确认有如下一行,没有则添加LoadModule fastcgi_module modules/mod_fastcgi.so6)安装smokeping(1)wget http:/oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz(2)tar zxvf tar zxvf smokeping-2.6.8.tar.gz(3)cd smokeping-2.6.8(4)./configure -prefix=/usr/local/smokeping这里出错了,看一下报错信息:checking checking for gnu make availablility. /usr/bin/gmake is GNU makechecking checking for perl module RRDs. Failedchecking checking for perl module FCGI. Okchecking checking for perl module CGI. Failedchecking checking for perl module CGI:Fast. Failedchecking checking for perl module Config:Grammar. Failedchecking checking for perl module Digest:HMAC_MD5. Failedchecking checking for perl module LWP. Failed* Aborting Configure *If you know where perl can find the missing modules, setthe PERL5LIB environment variable accordingly.FIRST though, make sure that perl starts the perlbinary you want to use for SmokePing.Now you can install local copies of the missing modulesby running./setup/build-perl-modules.sh /usr/local/smokeping/thirdpartyThe RRDs perl module is part of RRDtool. Either use the rrdtoolpackage provided by your OS or install rrdtool from source.If you install from source, the RRDs module is locatedPREFIX/lib/perl直接执行脚本,接下来就是在线等.来看下脚本的内容./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty还遇到问题:# checking checking for perl module RRDs. Failed解决办法:yum install rrdtool-perl重新configure./configure prefix=/usr/local/smokeping(5)/usr/bin/gmake install安装成功会产生以下几个目录rootlocalhost smokeping# ls /usr/local/smokeping/bin etc htdocs lib share thirdparty7)修改配置文件(1)进入bin目录,修改smokeping文件#vim smokeping第八行: use lib qw(); # PERL5LIB修改为: use lib qw(/usr/local/rrdtool/lib/perl5);(2)进入htdocs目录mv smokeping.fcgi.dist smokeping.fcgichmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist(3)进入etc目录cp config.dist config(4)修改config文件(以我的为例!只帖出要修改的部分,没有出现的不用修改,具体也可以参照centos5的)vim configrootlocalhost local# less /usr/local/smokeping/etc/config * General *imgcache = /var/www/html/smokeping/imgimgurl = 23/smokeping/imgdatadir = /usr/local/smokeping/datapiddir = /usr/local/smokeping/varcgiurl = 23/smokeping/smokeping.fcgi* Probes *+ FPingbinary = /usr/local/sbin/fping#* Slaves *#secrets=/usr/local/smokeping/etc/smokeping_secrets.dist#+boomer#display_name=boomer#color=0000ff#+slave2#display_name=another#color=00ff00* Targets *probe = FPingmenu = Toptitle = Network Latency Grapherremark = Welcome to the SmokePing website of xxx Company. Here you will learn all about the latency of our network.+ Testmenu= Targets#parents = owner:/Test/James location:/+ Jamesmenu = Jamestitle =James#alerts = someloss#slaves = boomer slave2host = #+ MultiHost#menu = Multihost#title = James and James as seen from Boomer#host = /Test/James /Test/Jamesboomer8)配置HTTP运行环境(1)创建目录mkdir -p /var/www/html/smokeping/img /var/www/html/smokeping/script/ /usr/local/smokeping/data /opt/smokeping/var (2)分配权限chown -R apache:apache /var/www/html/smokeping/img(3)建立软链接,把smokping目录下的文件软链接到HTTP目录下ln -s /usr/local/smokeping/htdocs/cropper /var/www/html/smokeping/cropper ln -s /usr/local/smokeping/htdocs/smokeping.fcgi /var/www/html/smokeping/smokeping.fcgi (4)修改HTTP配置文件vim /etc/httpd/conf/httpd.confchange AddHandler cgi-script .cgi to AddHandler cgi-script .cgiUnder change Options Indexes FollowSymLinks to Options Indexes FollowSymLinks ExecCGI9)创建smokeping执行脚本touch /etc/init.d/smokeping/创建脚本文件vim /etc/init.d/smokeping/增加配置脚本,内容如下:-#!/bin/bash# chkconfig: 2345 80 05# Description: Smokeping init.d script# Hacked by : jeff kang - # Get function from functions library. /etc/init.d/functions# Start the service Smokepingstart() echo -n Starting Smokeping: /usr/local/smokeping/bin/smokeping /dev/null 2&1# Create the lock file #touch /var/lock/subsys/smokepingsuccess $Smokeping startupecho# Restart the service Smokepingstop() echo -n Stopping Smokeping: kill -9 ps ax | grep /usr/local/smokeping/bin/smokeping | grep -v grep | awk print $1 /dev/null 2&1# Now, delete the lock file #rm -f /var/lock/subsys/smokepingsuccess $Smokeping shutdownecho# main logic #case $1 instart)start;stop)stop;status)status Smokeping;restart|reload|condrestart)stopstart;*)echo $Usage: $0 start|stop|restart|reload|statusexit 1esacexit 0-chmod 755 /etc/init.d/smokeping/增加可执行权限10)自动运行等配置:chkconfig smokeping on chkconfig httpd on 附apache配置文件rootlocalhost # more /etc/httpd/conf/httpd.confServerTokens OSServerRoot /etc/httpdPidFile run/httpd.pidTimeout 60KeepAlive OffMaxKeepAliveRequests 100KeepAliveTimeout 15StartServers 8MinSpareServers 5MaxSpareServers 20ServerLimit 256MaxClients 256MaxRequestsPerChild 4000StartServers 4MaxClients 300MinSpareThreads 25MaxSpareThreads 75 ThreadsPerChild 25MaxRequestsPerChild 0Listen 81LoadModule auth_basic_module modules/mod_auth_basic.soLoadModule auth_digest_module modules/mod_auth_digest.soLoadModule authn_file_module modules/mod_authn_file.soLoadModule authn_alias_module modules/mod_authn_alias.soLoadModule authn_anon_module modules/mod_authn_anon.soLoadModule authn_dbm_module modules/mod_authn_dbm.soLoadModule authn_default_module modules/mod_authn_default.soLoadModule authz_host_module modules/mod_authz_host.soLoadModule authz_user_module modules/mod_authz_user.soLoadModule authz_owner_module modules/mod_authz_owner.soLoadModule authz_groupfile_module modules/mod_authz_groupfile.soLoadModule authz_dbm_module modules/mod_authz_dbm.soLoadModule authz_default_module modules/mod_authz_default.soLoadModule ldap_module modules/mod_ldap.soLoadModule authnz_ldap_module modules/mod_authnz_ldap.soLoadModule include_module modules/mod_include.soLoadModule log_config_module modules/mod_log_config.soLoadModule logio_module modules/mod_logio.soLoadModule env_module modules/mod_env.soLoadModule ext_filter_module modules/mod_ext_filter.soLoadModule mime_magic_module modules/mod_mime_magic.soLoadModule expires_module modules/mod_expires.soLoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soLoadModule usertrack_module modules/mod_usertrack.soLoadModule setenvif_module modules/mod_setenvif.soLoadModule mime_module modules/mod_mime.soLoadModule dav_module modules/mod_dav.soLoadModule status_module modules/mod_status.soLoadModule autoindex_module modules/mod_autoindex.soLoadModule info_module modules/mod_info.soLoadModule dav_fs_module modules/mod_dav_fs.soLoadModule vhost_alias_module modules/mod_vhost_alias.soLoadModule negotiation_module modules/mod_negotiation.soLoadModule dir_module modules/mod_dir.soLoadModule actions_module modules/mod_actions.soLoadModule speling_module modules/mod_speling.soLoadModule userdir_module modules/mod_userdir.soLoadModule alias_module modules/mod_alias.soLoadModule substitute_module modules/mod_substitute.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_ftp_module modules/mod_proxy_ftp.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule cache_module modules/mod_cache.soLoadModule suexec_module modules/mod_suexec.soLoadModule disk_cache_module modules/mod_disk_cache.soLoadModule cgi_module modules/mod_cgi.soLoadModule version_module modules/mod_version.soLoadModule fastcgi_module modules/mod_fastcgi.soInclude conf.d/*.confUser apacheGroup apacheServerAdmin rootlocalhostUseCanonicalName OffDocumentRoot /var/www/html Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks ExecCGI AllowOverride None Order allow,deny Allow from all # # UserDir is disabled by default since it can confirm the presence # of a username on the system (depending on home directory # permissions). # UserDir disabled # # To enable requests to /user/ to serve the users public_html # directory, remove the UserDir disabled line above, and uncomment # the following line instead: # #UserDir public_htmlDirectoryIndex index.html index.html.varAccessFileName .htaccess Order allow,deny Deny from all Satisfy AllTypesConfig /etc/mime.typesDefaultType text/plain MIMEMagicFile conf/magicHostnameLookups OffErrorLog logs/error_logLogLevel warnLogFormat %h %l %u %t %r %s %b %Refereri %User-Agenti combinedLogFormat %h %l %u %t %r %s %b commonLogFormat %Refereri - %U refererLogFormat %User-agenti agentCustomLog logs/access_log combinedServerSignature OnAlias /icons/ /var/www/icons/ Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all # Location of the WebDAV lock database. DAVLockDB /var/lib/dav/lockdbScriptAlias /cgi-bin/ /var/www/cgi-bin/ AllowOverride None Options None Order allow,deny Allow from allIndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzipAddIconByType (TXT,/icons/text.gif) text/*AddIconByType (IMG,/icons/image2.gif) image/*AddIconByType (SND,/icons/sound2.gif) audio/*AddIconByType (VID,/icons/movie.gif) video/*AddIcon /icons/binary.gif .bin .exeAddIcon /icons/binhex.gif .hqxAddIcon /icons/tar.gif .tarAddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .ivAddIcon /icons/compressed.gif .Z .z .tgz .gz .zipAddIcon /icons/a.gif .ps .ai .epsAddIcon /icons/layout.gif .html .shtml .htm .pdfAddIcon /icons/text.gif .txtAddIcon /icons/c.gif .cAddIcon /icons/p.gif .pl .pyAddIcon /icons/f.gif .forAddIcon /icons/dvi.gif .dviAddIcon /icons/uuencoded.gif .uuAddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tclAddIcon /icons/tex.gif .texAddIcon /icons/bomb.gif coreAddIcon /icons/back.gif .AddIcon /icons/hand.right.gif READMEAddIcon /icons/folder.gif DIRECTORYAddIcon /icons/blank.gif BLANKICONDefaultIcon /icons/unknown.gifReadmeName README.htmlHeaderName HEADER.htmlIndexIgnore .?* * *# HEADER* README* RCS CVS *,v *,tAddLanguage ca .caAddLanguage cs .cz .csAddLang

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论