阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6.5 下 Smokeping 安装

210次阅读
没有评论

共计 4100 个字符,预计需要花费 11 分钟才能阅读完成。

Smokeping 是一款用于网络性能监测的监控软件,通过它可以在自己公司 IDC 的网络状况,如延时,丢包率,是否 BGP 多线等,通过 rrdtool 制图方式,图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况,

       Smokeping 需要多个包的支持,下面我们逐个安装,这里通过 yum 和编译安装两种方式。(有内置 yum 包直接 yum,没有的编译安装)

       yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl  httpd httpd-devel gcc make  wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel

       下载 fping 并编译:

       wget http://fping.org/dist/fping-3.10.tar.gz

       解压缩后,直接 configure  &&   make   &&   make install  即可

       下载 echoping 并编译安装:

       wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.2/echoping-6.0.2.tar.gz

       yum install -y popt

       yum install -y libidn   (安装两个 echoping 依赖的包)

       解压缩后, 直接 configure  &&   make   &&   make install  即可 

       下载 smokeping 

       http://download.csdn.net/download/fairplay_li/8711829  

       解压;cd  smokeping-2.6.9

       ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty

    ./configure –prefix=/usr/local/smokeping

    /usr/bin/gmake install

 

    以下开始配置 smokeping 

cd /usr/local/smokeping/
mkdir cache data var
touch /var/log/smokeping.log    
chown apache:apache cache data var
chown apache:apache /var/log/smokeping.log
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
cd /usr/local/smokeping/htdocs 
mv smokeping.fcgi.dist smokeping.fcgi
cd /usr/local/smokeping/etc
mv config.dist config

    vim config

    主要修改如下内容:

    cgiurl  = http://some.url/smokeping.cgi

  *** Database ***
  step    = 300  此处建议改为 60,一分钟采集一次数据
 
 
vim /etc/httpd/conf/httpd.conf  
 
  添加如下:
 

Alias /cache "/usr/local/smokeping/cache/"
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"
<Directory "/usr/local/smokeping">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
Order allow,deny
Allow from all
DirectoryIndex smokeping.fcgi
</Directory>
如果需要支持中文,需要安装中文编码:
 
yum -y install wqy-zenhei-fonts.noarch
 
vim  /usr/local/smokeping/lib/Smokeping/Graphs.pm 
 
my ($graphret,$xs,$ys) = RRDs::graph
            (“dummy”,
            ‘–start’, $tasks[0][1],
            ‘–end’, $tasks[0][2],
后,添加 
‘–font TITLE:20:”WenQuanYi Zen Hei Mono”‘,  
 
 
设置开机启动
echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local
 
监测源的 IP 库,填入到 config 中
 
+ Other
menu = 三大网络监控
title = 监控统计
++ dianxin
menu = 电信网络监控
title = 电信网络监控列表
host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj /Other/dianxin/dianxin-tj  /Other/dianxin/dianxin-sc  /Other/d
ianxin/dianxin-sh /Other/dianxin/dianxin-gz
+++ dianxin-bj 
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133

+++ dianxin-hlj 
menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242

+++ dianxin-tj
menu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132

+++ dianxin-sc 
menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69

+++ dianxin-sh 
menu = 上海电信
title = 上海电信
alerts = someloss
host = 116.228.111.118

+++ dianxin-gz 
menu = 广东电信
title = 广东电信
alerts = someloss
host = 113.111.211.22

++ liantong
menu = 联通网络监控
title = 联通网络监控列表
host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /Other/liantong/liantong-tj  /Other/liantong/liantong-sc  
/Other/liantong/liantong-sh /Other/liantong/liantong-gz

+++ liantong-bj 
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121

+++ liantong-hlj 
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69

+++ liantong-tj
menu = 天津联通
title = 天津联通
alerts = someloss
host = 202.99.96.68

+++ liantong-sc 
menu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6

+++ liantong-sh 
menu = 上海联通
title = 上海联通
alerts = someloss
host = 210.22.84.3

+++ liantong-gz 
menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88

++ yidong 
menu = 移动网络监控
title = 移动网络监控列表
host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj  /Other/yidong/yidong-sc  /Other/yidong/yi
dong-sh /Other/yidong/yidong-gz

+++ yidong-bj 
menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52

+++ yidong-hlj 
menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35

+++ yidong-tj
menu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5

+++ yidong-sc 
menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3

+++ yidong-sh 
menu = 上海移动
title = 上海移动
alerts = someloss
host = 117.131.19.23

+++ yidong-gz 
menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6

更多 CentOS 相关信息见 CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-06/132468.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计4100字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中