首页 > 其他 > 详细

CentOS6.4安装Smokeping节点监控软件

时间:2015-12-30 13:07:57      阅读:866      评论:0      收藏:0      [点我收藏+]

Smokeping:它是rrdtool的作者制作的,在图形显示方面很漂亮,可以用来很好的检测网络状态和稳定性,下面简单说一下Smokeping的安装以及配置方法。

 

1.首先安装LAMP环境

yum install httpd mysql mysql-server php php* php-mysql -y

2.配置PHP 

vi /etc/php.ini      
##  修改946行的时区
      946 date.timezone = PRC

3.安装Smokeping所需的开发包

yum install cairo-devel libxml2-devel pango-devel pangolibpng-develfreetypefreetype-devellibart_lgpl-devel *rrdtool* ruby perl-CPAN http* gcc-c++ gcc* -y

4.安装rrdtool   

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz
tar zxvf rrdtool-1.4.7.tar.gz
cd rrdtool-1.4.7 && ./configure && make && make install

5.安装Smokeping-2.6.8

cd ~
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
tar zxf smokeping-2.6.8.tar.gz
cd smokeping-2.6.8 && ./configure --prefix=/opt/smokeping

注意:到编译Smokeping的时候会提示CGI错误,代码如下,根据代码我们执行红色部分的提示即可

checking checking for gnu make availablility... /usr/bin/gmake is GNU make
checking checking for perl module RRDs... Ok
checking checking for perl module FCGI... Failed
checking checking for perl module CGI... Failed
checking checking for perl module CGI::Fast... Failed
checking checking for perl module Config::Grammar... Failed
checking checking for perl module Digest::HMAC_MD5... Failed
checking checking for perl module LWP... Failed

** Aborting Configure ******************************

   If you know where perl can find the missing modules, set
   the PERL5LIB environment variable accordingly.

   FIRST though, make sure that perl starts the perl
   binary you want to use for SmokePing.

   Now you can install local copies of the missing modules
   by running

     ./setup/build-perl-modules.sh /opt/smokeping/thirdparty

   The RRDs perl module is part of RRDtool. Either use the rrdtool
   package provided by your OS or install rrdtool from source.
   If you install from source, the RRDs module is located
   PREFIX/lib/perl

执行./setup/build-perl-modules.sh /opt/smokeping/thirdparty 来解决问题 接着在执行一下编译命令

./configure --prefix=/opt/smokeping 

1.)如果出现以下报错 就执行一下 yum install cpan -y

 

checkingchecking for perl module RRDs... Ok
checkingchecking for perl module FCGI... Failed
checkingchecking for perl module CGI... Ok
checkingchecking for perl module CGI::Fast... Failed
checkingchecking for perl module Config::Grammar... Failed
checkingchecking for perl module Digest::HMAC_MD5... Ok
checkingchecking for perl module LWP... Ok

问题:没有安装 FCGI CGI::Fast等

解决办法:用cpan可以很方便来安装

# perl -MCPAN -e ‘install FCGI‘

其它未安装的模块,做相应的替换:

# perl -MCPAN -e ‘install FCGI‘

# perl -MCPAN -e ‘install CGI::Fast‘

# perl -MCPAN -e ‘install Config::Grammar‘

如果有揭示未安装cpan,则用yum进行安装

 

没报错的话就直接安装smokeping

/usr/bin/gmake install

6.安装成功后查看 /opt/smokeping下是不是有bin  etc  htdocs  lib  share  thirdparty文件

[root@Smokeping smokeping-2.6.8]# ls /opt/smokeping/
bin  etc  htdocs  lib  share  thirdparty

7.安装fping

cd ~
wget http://www.fping.org/dist/fping-3.5.tar.gz
cd fping-3.5 && ./configure && make && make install

8.配置Smokeping

cd /opt/smokeping
mkdir date && mkdir cache && mkdir var            //创建 data  cache  var三个目录
chown -R apache.apache /opt/smokeping/       //赋权限
cp etc/config.dist etc/config               //复制一个配置文件
cd htdocs/
cp smokeping.fcgi.dist smokeping.fcgi 
cd /var/www/html
ln -s  /opt/smokeping/htdocs/  smokeping     //在html 目录下建立一个 smokeping的目录软连接 ,此软连接到 /opt/smokeping/htdocs/ 目录下
cd /opt/smokeping/htdocs
ln -s /opt/smokeping/cache  cache
ln -s smokeping.fcgi smokeping.cgi

9.修改Smokeping的配置文件

vi /opt/smokeping/etc/config  

把14行的cgiurl   = http://some.url/smokeping.cgi  改为自己的IP地址

cgiurl   = http://42.51.152.166/smokeping/smokeping.cgi

然后搜素binary 这个地址是等于 fping的地址  不知道fping地址的可以使用whereis fping

    106 + FPing
    107 
    108 binary = /usr/local/sbin/fping

接着搜素 Presentation  在48行下面  加入中文的支持

     48   *** Presentation ***
     49   charset = utf8

在最后一行加入以下代码

    148 + yanghongfei          ##一级菜单
    149 menu = 郑州            ##一级菜单名称
    150 title = 郑州           ##一级菜单表头名称
    151 
    152 ++ jinshui
    153 menu = 金水
    154 title = 金水
    155 host = 42.51.51.51     ##指定的主机IP

 

10.修改配置文件/opt/smokeping/bin/smokeping

vi /opt/smokeping/bin/smokeping

      7   use FindBin;
      8 use lib qw(usr/local/rrdtool/lib/perl);
      9 use lib "$FindBin::Bin/../thirdparty/lib/perl5";
     10 use lib "$FindBin::Bin/../lib";
chmod 600 /opt/smokeping/etc/smokeping_secrets.dist

11.修改 apache 的配置文件

 

 

CentOS6.4安装Smokeping节点监控软件

原文:http://www.cnblogs.com/yangxiaofei/p/5088229.html

(0)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!