1 通过 yum 安装依赖的库以及环境

yum install rrdtool wqy* fping curl bind-utils httpd httpd-devel \ perl perl-FCGI perl-CGI perl-CGI-SpeedyCGI perl-libwww-perl perl-Socket6 perl-Net-Telnet perl-Net-OpenSSH perl-Net-DNS perl-LDAP perl-IO-Socket-SSL perl-ExtUtils-MakeMaker rrdtool-perl perl-Sys-Syslog

2 编译安装 smokeping

cd /usr/local/src/
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar xvf smokeping-2.6..tar.gz
cd smokeping-2.6.
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
gmake install

3 配置 smokeping 相关文件目录

cd /usr/local/smokeping/
mkdir cache data var
touch /var/log/smokeping.log
chown apache.apache cache/ data/ var/ /var/log/smokeping.log
cd /usr/local/smokeping/htdocs/
cp smokeping.fcgi.dist smokeping.fcgi
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
vim /usr/local/smokeping/etc/config # 修改 /usr/local/smokeping/etc/config 文件 # 修改 cgiurl
sed -i 's#some.url#192.168.56.11#' /usr/local/smokeping/etc/config # 默认检测时间 秒修改 秒
sed -i 's#300#60#g' /usr/local/smokeping/etc/config # 默认 秒 ping 次,修改为 秒 ping 次
sed -i 's#pings = 20#pings = 60#' /usr/local/smokeping/etc/config # 在 presentation 后添加 utf- 中文字符集
vim /usr/local/smokeping/etc/config *** Presentation *** charset = utf- # 修改密码文件权限
chmod /usr/local/smokeping/etc/smokeping_secrets.dist

4 配置 apache

4.1 设置登录密码认证

htpasswd -c /usr/local/smokeping/htdocs/htpasswd jamin

4.2 修改 apache 配置文件,配置 smokeping 站点目录

vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html" 下添加如下内容 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
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>

5 启动服务以及访问 smokeping

systemctl start httpd
/usr/local/smokeping/bin/smokeping
访问 URL:
http://服务器ip/smokeping

6  smokeping 使用

6.1 添加需要监控的节点

注意事项:

1 在 /usr/local/smokeping/etc/config 中添加
2 smokeping 就这点不好,添加节点不能在前台 Web 页面添加,一定要在后台的配置文件中添加
3 修改 /usr/local/smokeping/etc/config 后,必须重启 smokeping 程序,配置才会生效 
4 smokeping 会根据配置文件 config 在 /usr/local/smokeping/data 之下添加文件夹及子文件夹
5 用 VMware Workstation 的虚拟机测试有一点好处,虚拟网卡可以设置出入的丢包率,适合 smokeping 做丢包测试,经过测试 smokeping 检测出的丢包率与 VMware Workstation 虚拟网卡设置的丢包率基本相同,也就是说 smokeping 能够反应网络的真实状况

添加监控节点示例:注意 + 是第一层,++ 是第二层,+++ 是第三层

以下附上一份三大运营商网络监控样例配置(在 /usr/local/smokeping/etc/config 最后添加):

+ Other
menu = 三大网络监控
title = 监控统计 ++ CT menu = 电信网络监控
title = 电信网络监控列表
host = /Other/CT/CT-BJ /Other/CT/CT-TJ /Other/CT/CT-HLJ /Other/CT/CT-SH /Other/CT/CT-SC /Other/CT/CT-GZ +++ CT-BJ menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133 +++ CT-TJ menu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132 +++ CT-HLJ menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242 +++ CT-SH menu = 上海电信
title = 上海电信
alerts = someloss
host = 116.228.111.118 +++ CT-SC menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69 +++ CT-GZ menu = 广东电信
title = 广东电信
alerts = someloss
host = 113.111.211.22 ++ CU menu = 联通网络监控
title = 联通网络监控列表
host = /Other/CU/CU-BJ /Other/CU/CU-TJ /Other/CU/CU-HLJ /Other/CU/CU-SH /Other/CU/CU-SC /Other/CU/CU-GZ +++ CU-BJ menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121 +++ CU-TJ menu = 天津联通
title = 天津联通
alerts = someloss
host = 202.99.96.68 +++ CU-HLJ menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69 +++ CU-SH menu = 上海联通
title = 上海联通
alerts = someloss
host = 210.22.84.3 +++ CU-SC menu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6 +++ CU-GZ menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88 ++ CMCC menu = 移动网络监控
title = 移动网络监控列表
host = /Other/CMCC/CMCC-BJ /Other/CMCC/CMCC-TJ /Other/CMCC/CMCC-HLJ /Other/CMCC/CMCC-SH /Other/CMCC/CMCC-SC /Other/CMCC/CMCC-GZ +++ CMCC-BJ menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52 +++ CMCC-TJ menu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5 +++ CMCC-HLJ menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35 +++ CMCC-SH menu = 上海移动
title = 上海移动
alerts = someloss
host = 117.131.19.23 +++ CMCC-SC menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3 +++ CMCC-GZ menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6

参考文章:http://jaminzhang.github.io/monitoring/smokeping-deploy-practice/#top4

报错

1 .fping yum安装没有正常安装上去,需手动下载fping安装包,源码安装,在配置文件中修改fping命令的路径

2.  安装./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty 时安装不上,可从另外能成功安装的一台上tar 打包文件夹thirdparty, 再传到这台解压缩到相应目录。

遇到部分IP不能直接进行ping操作,可用tcping命令结合smokeping , 必须在Centos 6 上部署。

先安装 tcping 命令

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute

Finally, download tcpping from the web.

$ cd /usr/bin
$ sudo wget http://www.vdberg.org/~richard/tcpping
$ sudo chmod tcpping

To measure network latency by using tcpping, simply run it as follows.

$ tcpping www.cnn.com
seq : tcp response from 157.166.240.13 [open] 82.544 ms
seq : tcp response from 157.166.241.10 [open] 80.771 ms
seq : tcp response from 157.166.241.11 [open] 80.838 ms
seq : tcp response from 157.166.241.10 [open] 80.145 ms
seq : tcp response from 157.166.240.11 [open] 86.253 ms

tcping 结合smokeping 配置文件示例:

*** General ***

owner    = Peter Random
contact = some@address.nowhere
mailhost = my.mail.host
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 = http://192.168.56.11/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail.dist
tmail = /usr/local/smokeping/etc/tmail.dist
# 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@address.somewhere
from = smokealert@company.xy +someloss
type = loss
# in percent
pattern = >%,**,>%,**,>%
comment = loss times in a row *** Database *** step =
pings = # consfn mrhb steps total AVERAGE 0.5
AVERAGE 0.5
MIN 0.5
MAX 0.5
AVERAGE 0.5
MAX 0.5
MIN 0.5 *** Presentation ***
charset = utf-
template = /usr/local/smokeping/etc/basepage.html.dist + charts menu = Charts
title = The most interesting destinations ++ stddev
sorter = StdDev(entries=>)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f ++ max
sorter = Max(entries=>)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds ++ loss
sorter = Loss(entries=>)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f ++ median
sorter = Median(entries=>)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds + overview width =
height =
range = 10h + detail width =
height =
unison_tolerance = "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 *** + TCPPing binary = /usr/bin/tcpping
forks =
offset = %
step =
#tcptraceroute = -e "sudo /usr/bin/tcptraceroute"
timeout = *** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
color=0000ff +slave2
display_name=another
color=00ff00 *** Targets *** probe = TCPPing 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. + mytarget menu = TestTCP
title = TestTCP
host = 82.223.245.88
pings =
port =

参考文章:https://oss.oetiker.ch/smokeping/probe/TCPPing.en.html

http://blog.xuite.net/pt.hsu/life/59708395-Smokeping%E4%B9%8BTCPPing%E6%A8%A1%E7%B5%84%E7%AF%87.

SmokePing 部署实践的更多相关文章

  1. 基于AWS的自动化部署实践

    过年前,我给InfoQ写了篇文章详细介绍我们团队在过去4年基于AWS的自动化部署实践.文章包括了:为什么选择AWS.AWS上自动化部署的优势和挑战.我们的解决方案,以及和AWS DevOps方案(Op ...

  2. 基于winserver的Apollo配置中心分布式&集群部署实践(正确部署姿势)

    基于winserver的Apollo配置中心分布式&集群部署实践(正确部署姿势)   前言 前几天对Apollo配置中心的demo进行一个部署试用,现公司已决定使用,这两天进行分布式部署的时候 ...

  3. winserver的consul部署实践与.net core客户端使用(附demo源码)

    winserver的consul部署实践与.net core客户端使用(附demo源码)   前言 随着微服务兴起,服务的管理显得极其重要.都知道微服务就是”拆“,把臃肿的单块应用,拆分成多个轻量级的 ...

  4. 《OpenStack部署实践》

    <OpenStack部署实践> 基本信息 作者: 张子凡 丛书名: 图灵原创 出版社:人民邮电出版社 ISBN:9787115346797 上架时间:2014-2-27 出版日期:2014 ...

  5. Zabbix3.0部署实践

    Zabbix3.0部署实践   Zabbix3整个web界面做了一个全新的设计. 1.1Zabbix环境准备 [root@linux-node1 ~]# cat /etc/redhat-release ...

  6. smokeping部署安装

    smokeping部署安装 部署情况: 服务器IP:192.168.10.18 smokeping部署在/var/www/html/smokeping目录 smokeping部分命令: smokepi ...

  7. Jenkins+SVN+Maven+shell 自动化部署实践

      JAVA环境中利用Jenkins+svn+maven进行自动化部署实践   一. 前言2 1.介绍jenkins2 1.本地项目打包2 2.通过secureCRT工具,手动传输到服务器2 3.然后 ...

  8. 基于 Docker 和 GitLab 的前端自动化部署实践笔记

    基于 Docker 和 GitLab 的前端自动化部署 实践笔记 随着接触的项目越来越多,在部署测试流程上重复耗时工作也越来越多,所以对前端工作的CI/CD实现愈发迫在眉睫. 前端开发由于三大框架的崛 ...

  9. 理想的DevOp流程怎么做?看看Slack的代码部署实践 原创 Michael Deng 高可用架构 今天

    理想的DevOp流程怎么做?看看Slack的代码部署实践 原创 Michael Deng  高可用架构  今天

随机推荐

  1. vue项目中使用ueditor

      以vue-cli生成的项目为例 1.static文件夹下先放入ueditor文件 2.index.html添加如下代码 <script type="text/javascript& ...

  2. vuejs中执行npm run dev出现页面cannot GET/问题

    1.问题描述 最近用vue-cli搭建了一个小项目,其中在对项目进行打包测试时修改了webpack.base.conf.js中的配置信息,之后再用npm run dev之后出现如下的情况: 最近又有网 ...

  3. LAMP环境跟LNMP环境有什么不同,主要用什么地方

    LAMP即Linux+Apache+Mysql/MariaDB+Perl/PHP/Python Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网 ...

  4. php 邓士鹏

    // $is_company = $_groupid > 5 || ($_groupid == 4 && $user['regid'] > 5); $_E = ($MOD[ ...

  5. IT项目角色标准定义

    角色 角色标准定义 项目主管 负责协助项目经理分配资源,确定优先级,协调公司和项目组之间的沟通.保证项目团队一直处于良好的状态中.同时监督项目经理的工作方法,以确保项目以及工件符合公司的发展方向以及用 ...

  6. 图文教程:在Mac上搭建Titanium的iOS开发环境

    http://mobile.51cto.com/web-317170_all.htm 跨平台开发工具Titanium的兴起之路:HTML 5是最大威胁 比较Titanium和PhoneGap两大iOS ...

  7. linux 巨页使用测试以及勘误1

    linux使用hugetlbfs的方式来支持巨页,也成为大页. 网上看到有人说巨页不支持read,和write调用,只支持mmap,但是看3.10内核代码的时候发现: const struct fil ...

  8. mysql 存在索引但不能使用索引的典型场景

    mysql 演示数据库:http://downloads.mysql.com/docs/sakila-db.zip 以%开头的LIKE查询不能够利用B-tree索引 explain select * ...

  9. 什么是bgp线路

    https://www.douban.com/note/319956581/ BGP(边界网关协议)主要用于互联网AS(自治系统)之间的互联,BGP的最主要功能在于控制路由的传播和选择最好的路由.中国 ...

  10. j2e应用相关技术

    j2e应用相关技术 轻量级j2e应用以传统的jsp作为变现层技术,以一系列开源框架作为MVC层,中间件,持久层解决方案,并将这些开源框架有机组合在一起,使得j2e具有高度的可扩展性,可维护性. ser ...