Centos6.5搭建smokeping服务

1.安装所需软件包。

yum install -y perl perl-Net-Telnetperl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl httpdhttpd-devel gcc make wget libxml2-devel libpng-devel glib pango pango-develfreetype freetype-devel fontconfig cairo cairo-devel libart_lgpllibart_lgpl-devel popt popt-devel libidn libidn-devel

2.创建一个放置软件包的常用目录。

mkdir /smokeping/tools –p

3.下载fping软件包,并且解压,编译安装。

wget /dist/fping-
tar -zxvf fping-
cd fping-/
./configure
make && make install
cd ..

4.下载echoping并且解压,编译安装。

wget /linux/misc/old/echoping-
tar -zxvf echoping-
cd echoping-/
./configure
make && make install

5.下载smokeping并且解压,编译安装。

wget /smokeping/pub/smokeping-
tar -zxvf smokeping-
cd smokeping-/
./setup/build-perl-/usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
gmake install

6.创建三个文件目录和一个日志文件,并且设置属主和属组均为apache

cd /usr/local/smokeping/
mkdir {cache,data,var}
touch /var/log/
chown  /var/log/
chmod 600/usr/local/smokeping/etc/smokeping_
chown -R  data/
chown -R  var/
chown -R  cache/

7.修改相应的配置文件。

cd /usr/local/smokeping/htdocs/
mv  
cd /usr/local/smokeping/etc/
mv  config

8.配置apache配置文件和smokeping的配置文件。

在/etc/httpd/conf/末尾添加以下加行:
Alias /cache "/usr/local/smokeping/cache/"  
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"  
Alias /smokeping "/usr/local/smokeping/htdocs/"  
<Directory "/usr/local/smokeping">  
AllowOverride None  
Options All  
AddHandler cgi-script .fcgi .cgi  
Order allow,deny  
Allow from all  
DirectoryIndex   
</Directory>  
smokeping配置文件如下所示:

cat /usr/local/smokeping/etc/config 
*** General ***

owner    = Peter Random
contact  = some@
mailhost = 
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
imgcache = /usr/local/smokeping/cache
imgurl   = cache
datadir  = /usr/local/smokeping/data
piddir  = /usr/local/smokeping/var
cgiurl   = /
smokemail = /usr/local/smokeping/etc/
tmail = /usr/local/smokeping/etc/
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no

*** Alerts ***
to = alertee@
from = smokealert@

+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

*** Database ***

step     = 300
pings    = 20

# consfn mrhb steps total

AVERAGE     1  1008
AVERAGE    12  4320
    MIN    12  4320
    MAX    12  4320
AVERAGE   144   720
    MAX   144   720
    MIN   144   720

*** Presentation ***

template = /usr/local/smokeping/etc/
charset = utf-8
+ charts

menu = Charts
title = The most interesting destinations

++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f

++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds

++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f

++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds

+ overview 

width = 600
height = 50
range = 10h

+ detail

width = 600
height = 200
unison_tolerance = 2

"Last 3 Hours"    3h
"Last 30 Hours"   30h
"Last 10 Days"    10d
"Last 400 Days"   400d

#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location

*** Probes ***

+ FPing

binary = /usr/local/sbin/fping

*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_
+boomer
display_name=boomer
color=0000ff

+slave2
display_name=another
color=00ff00

*** Targets ***

probe = FPing

menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
         Here you will learn all about the latency of our network.

+ Test
menu= Targets
#parents = owner:/Test/James location:/

++ James

menu = James
title =James
alerts = someloss
slaves = boomer slave2
host = 

++ MultiHost

menu = Multihost
title = James and James as seen from Boomer
host = /Test/James /Test/James~boomer

++ Localhost

menu = Localhost
title = Localhost
alerts = someloss
#slaves = boomer slave2
host = 

+ Other 
menu = 网络及节点监控 
title = 监控统计 
++ dianxin 
menu = 电信网络监控 
title = 电信网络监控列表 
host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-sh /Other/dianxin/dianxin-gz /Other/dianxin/dianxin-sz /Other/dianxin/dianxin-tj /Other/dianxin/dianxin-sy /Other/dianxin/dianxin-xa /Other/dianxin/dianxin-jn /Other/dianxin/dianxin-cd /Other/dianxin/dianxin-hf /Other/dianxin/dianxin-wh /Other/dianxin/dianxin-zz /Other/dianxin/dianxin-cs /Other/dianxin/dianxin-nj /Other/dianxin/dianxin-hz /Other/dianxin/dianxin-xm /Other/dianxin/dianxin-nn /Other/dianxin/dianxin-ty /Other/dianxin/dianxin-cc /Other/dianxin/dianxin-lz /Other/dianxin/dianxin-nn /Other/dianxin/dianxin-xn /Other/dianxin/dianxin-hk /Other/dianxin/dianxin-fz /Other/dianxin/dianxin-gy /Other/dianxin/dianxin-km /Other/dianxin/dianxin-xj /Other/dianxin/dianxin-xz /Other/dianxin/dianxin-heb /Other/dianxin/dianxin-hhht

+++ dianxin-bj 
menu = 北京电信 
title = 北京电信 
alerts = someloss 
host = 

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

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

+++ dianxin-sz
menu = 深圳电信 
title = 深圳电信 
alerts = someloss 
host = 

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

+++ dianxin-sy
menu = 沈阳电信 
title = 沈阳电信 
alerts = someloss 
host =  

+++ dianxin-xa
menu = 西安电信
title = 西安电信
alerts = someloss
host = 

+++ dianxin-jn
menu = 济南电信
title = 济南电信
alerts = someloss
host = 

+++ dianxin-cd
menu = 成都电信
title = 成都电信
alerts = someloss
host = 

+++ dianxin-hf
menu = 合肥电信
title = 合肥电信
alerts = someloss
host = 

+++ dianxin-wh
menu = 武汉电信
title = 武汉电信
alerts = someloss
host = 

+++ dianxin-zz
menu = 郑州电信
title = 郑州电信
alerts = someloss
host = 

+++ dianxin-cs
menu = 长沙电信
title = 长沙电信
alerts = someloss
host = 

+++ dianxin-nj
menu = 南京电信
title = 南京电信
alerts = someloss
host = 

+++ dianxin-hz
menu = 杭州电信
title = 杭州电信
alerts = someloss
host = 

+++ dianxin-xm
menu = 厦门电信
title = 厦门电信
alerts = someloss
host = 

+++ dianxin-nn
menu = 南宁电信
title = 南宁电信
alerts = someloss
host = 

+++ dianxin-ty
menu = 太原电信
title = 太原电信
alerts = someloss
host = 

+++ dianxin-cc
menu = 长春电信
title = 长春电信
alerts = someloss
host = 

+++ dianxin-lz
menu = 兰州电信
title = 兰州电信
alerts = someloss
host = 

+++ dianxin-nc
menu = 南昌电信
title = 南昌电信
alerts = someloss
host = 

+++ dianxin-xn
menu = 西宁电信
title = 西宁电信
alerts = someloss
host = 

+++ dianxin-hk
menu = 海口电信
title = 海口电信
alerts = someloss
host = 

+++ dianxin-fz
menu = 福州电信
title = 福州电信
alerts = someloss
host = 

+++ dianxin-gy
menu = 贵阳电信
title = 贵阳电信
alerts = someloss
host = 

+++ dianxin-km
menu = 昆明电信
title = 昆明电信
alerts = someloss
host = 

+++ dianxin-xj
menu = 新疆电信
title = 新疆电信
alerts = someloss
host = 

+++ dianxin-xz
menu = 西藏电信
title = 西藏电信
alerts = someloss
host = 

+++ dianxin-heb
menu = 哈尔滨电信
title = 哈尔滨电信
alerts = someloss
host = 

+++ dianxin-hhht
menu = 呼和浩特电信
title = 呼和浩特电信
alerts = someloss
host = 

++ liantong 
menu = 联通网络监控 
title = 联通网络监控列表 
host = /Other/liantong/liantong-bj /Other/liantong/liantong-sh /Other/liantong/liantong-gz /Other/liantong/liantong-sz /Other/liantong/liantong-tj /Other/liantong/liantong-sy /Other/liantong/liantong-xa /Other/liantong/liantong-jn /Other/liantong/liantong-qd /Other/liantong/liantong-cd /Other/liantong/liantong-ah /Other/liantong/liantong-wh /Other/liantong/liantong-zz /Other/liantong/liantong-cs /Other/liantong/liantong-nj /Other/liantong/liantong-hz /Other/liantong/liantong-xm /Other/liantong/liantong-nn /Other/liantong/liantong-nc /Other/liantong/liantong-ty /Other/liantong/liantong-xn /Other/liantong/liantong-gz /Other/liantong/liantong-fz /Other/liantong/liantong-lz /Other/liantong/liantong-km /Other/liantong/liantong-xj /Other/liantong/liantong-xz /Other/liantong/liantong-heb /Other/liantong/liantong-hhht

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

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

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

+++ liantong-sz
menu = 深圳联通 
title = 深圳联通 
alerts = someloss 
host =  

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

+++ liantong-sy
menu = 沈阳联通 
title = 沈阳联通 
alerts = someloss 
host = 

+++ liantong-xa
menu = 西安联通
title = 西安联通
alerts =  someloss
host = 

+++ liantong-jn
menu = 济南联通
title = 济南联通
alerts =  someloss
host = 

+++ liantong-qd
menu = 青岛联通
title = 青岛联通
alerts =  someloss
host = 

+++ liantong-cd
menu = 成都联通
title = 成都联通
alerts =  someloss
host = 

+++ liantong-ah
menu = 安徽联通
title = 安徽联通
alerts =  someloss
host = 

+++ liantong-wh
menu = 武汉联通
title = 武汉联通
alerts =  someloss
host = 

+++ liantong-zz
menu = 郑州联通
title = 郑州联通
alerts =  someloss
host = 

+++ liantong-cs
menu = 长沙联通
title = 长沙联通
alerts =  someloss
host = 

+++ liantong-nj
menu = 南京联通
title = 南京联通
alerts =  someloss
host = 

+++ liantong-hz
menu = 杭州联通
title = 杭州联通
alerts =  someloss
host = 

+++ liantong-xm
menu = 厦门联通
title = 厦门联通
alerts =  someloss
host = 

+++ liantong-nn
menu = 南宁联通  
title = 南宁联通
alerts =  someloss
host = 

+++ liantong-nc
menu = 南昌联通
title = 南昌联通
alerts =  someloss
host = 

+++ liantong-ty
menu = 太原联通
title = 太原联通
alerts =  someloss
host = 

+++ liantong-xn
menu = 西宁联通
title = 西宁联通
alerts =  someloss
host = 

+++ liantong-gy
menu = 贵阳联通
title = 贵阳联通
alerts =  someloss
host =  

+++ liantong-fz
menu = 福州联通
title = 福州联通
alerts =  someloss
host = 

+++ liantong-lz
menu = 兰州联通
title = 兰州联通
alerts =  someloss
host = 

+++ liantong-km
menu = 昆明联通
title = 昆明联通
alerts =  someloss
host = 

+++ liantong-xj
menu = 新疆联通
title = 新疆联通
alerts =  someloss
host = 

+++ liantong-xz
menu = 西藏联通
title = 西藏联通
alerts =  someloss
host = 

+++ liantong-heb
menu = 哈尔滨联通
title = 哈尔滨联通
alerts =  someloss
host = 


+++ liantong-hhht
menu = 呼和浩特联通
title = 呼和浩特联通
alerts =  someloss
host = 

++ yidong 
menu = 移动网络监控 
title = 移动网络监控列表 
host = /Other/yidong/yidong-bj /Other/yidong/yidong-sh /Other/yidong/yidong-gz /Other/yidong/yidong-sz /Other/yidong/yidong-tj /Other/yidong/yidong-sy /Other/yidong/yidong-xa /Other/yidong/yidong-jn /Other/yidong/yidong-qd /Other/yidong/yidong-cd /Other/yidong/yidong-hf /Other/yidong/yidong-wh /Other/yidong/yidong-zz /Other/yidong/yidong-cs /Other/yidong/yidong-nj /Other/yidong/yidong-nc /Other/yidong/yidong-gy /Other/yidong/yidong-fz /Other/yidong/yidong-lz  /Other/yidong/yidong-km /Other/yidong/yidong-hz /Other/yidong/yidong-nn /Other/yidong/yidong-wlmq /Other/yidong/yidong-ls

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

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

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

+++ yidong-sz
menu = 深圳移动 
title = 深圳移动 
alerts = someloss 
host =  

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

+++ yidong-sy
menu = 沈阳移动
title = 沈阳移动
alerts = someloss
host = 

+++ yidong-xa
menu = 西安移动
title = 西安移动
alerts = someloss
host =  

+++ yidong-jn
menu = 济南移动
title = 济南移动
alerts = someloss
host = 

+++ yidong-qd
menu = 青岛移动
title = 青岛移动
alerts = someloss
host = 

+++ yidong-cd
menu = 成都移动
title = 成都移动
alerts = someloss
host = 

+++ yidong-hf
menu = 合肥移动
title = 合肥移动
alerts = someloss
host = 

+++ yidong-wh
menu = 武汉移动
title = 武汉移动
alerts = someloss
host = 

+++ yidong-zz
menu = 郑州移动
title = 郑州移动
alerts = someloss
host = 

+++ yidong-cs
menu = 长沙移动
title = 长沙移动
alerts = someloss
host = 

+++ yidong-nj
menu = 南京移动
title = 南京移动
alerts = someloss
host = 

+++ yidong-hz
menu = 杭州移动
title = 杭州移动
alerts = someloss
host = 

+++ yidong-nn
menu = 南宁移动
title = 南宁移动
alerts = someloss
host = 

+++ yidong-nc
menu = 南昌移动
title = 南昌移动
alerts = someloss
host = 

+++ yidong-gy
menu = 贵阳移动
title = 贵阳移动
alerts = someloss
host = 

+++ yidong-fz
menu = 福州移动
title = 福州移动
alerts = someloss
host = 

+++ yidong-lz
menu = 兰州移动
title = 兰州移动
alerts = someloss
host = 


+++yidong-km
menu = 昆明移动
title = 昆明移动
alerts = someloss
host = 

+++ yidong-wlmq
menu = 乌鲁木齐移动
title = 乌鲁木齐移动
alerts = someloss
host = 

+++ yidong-ls
menu = 拉萨移动
title = 拉萨移动
alerts = someloss
host = 

9.分别启动smokepinghttpd。

/usr/local/smokeping/bin/smokeping
ps -ef | grep smoke
hadoop    21848  19908 0 11:20 pts/1    00:00:00 grepsmoke
root    177131      1  0 Sep27 ?        00:00:38/usr/local/smokeping/bin/smokeping [FPing]
/etc//httpd start
-ef | grep httpd
hadoop    22245  19908 0 11:21 pts/1    00:00:00 grephttpd
root     177152      1 0 Sep27 ?        00:00:00/usr/sbin/httpd
apache   177154 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177155 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177156 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177157 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177158 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177159 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177160 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177161 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177373 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache   177378 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd
apache  179726 177152  0 Sep27 ?        00:00:00 /usr/sbin/httpd

10.smokeping界面支持中文

安装字体
yum -y install wqy-zenhei-
编辑smokeping的配置文件vim /usr/local/smokeping/etc/config
第50行添加
charset = utf-8 #添加此行
编辑这个文件  vim /usr/local/smokeping/lib/Smokeping/#第147行下边插入下边一行
'--fontTITLE:20:"WenQuanYi Zen Hei Mono"',

11.访问地址,看下是否可以出现smokeping页面。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值