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.11.tar.gz
cd smokeping-2.6.11
./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# 默认检测时间 300 秒修改 60 秒
sed -i 's#300#60#g' /usr/local/smokeping/etc/config        # 默认 60 秒 ping 20 次,修改为 60 秒 ping 60 次
sed -i 's#pings    = 20#pings    = 60#' /usr/local/smokeping/etc/config# 在 presentation 后添加 utf-8 中文字符集
vim /usr/local/smokeping/etc/config               *** Presentation ***charset = utf-8# 修改密码文件权限
chmod 600 /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 NoneOptions AllAddHandler cgi-script .fcgi .cgiOrder allow,denyAllow from allAuthName "Smokeping"AuthType BasicAuthUserFile /usr/local/smokeping/htdocs/htpasswdRequire valid-userDirectoryIndex 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 = 监控统计++ CTmenu = 电信网络监控
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-BJmenu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133+++ CT-TJmenu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132+++ CT-HLJmenu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242+++ CT-SHmenu = 上海电信
title = 上海电信
alerts = someloss
host = 116.228.111.118+++ CT-SCmenu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69+++ CT-GZmenu = 广东电信
title = 广东电信
alerts = someloss
host = 113.111.211.22++ CUmenu = 联通网络监控
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-BJmenu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121+++ CU-TJmenu = 天津联通
title = 天津联通
alerts = someloss
host = 202.99.96.68+++ CU-HLJmenu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69+++ CU-SHmenu = 上海联通
title = 上海联通
alerts = someloss
host = 210.22.84.3+++ CU-SCmenu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6+++ CU-GZmenu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88++ CMCCmenu = 移动网络监控
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-BJmenu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52+++ CMCC-TJmenu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5 +++ CMCC-HLJmenu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35+++ CMCC-SHmenu = 上海移动
title = 上海移动
alerts = someloss
host = 117.131.19.23+++ CMCC-SCmenu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3+++ CMCC-GZmenu = 广东移动
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 755 tcpping

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

$ tcpping www.cnn.com
seq 0: tcp response from 157.166.240.13 [open] 82.544 ms
seq 1: tcp response from 157.166.241.10 [open] 80.771 ms
seq 2: tcp response from 157.166.241.11 [open] 80.838 ms
seq 3: tcp response from 157.166.241.10 [open] 80.145 ms
seq 4: 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 = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row*** Database ***step     = 60
pings    = 60# consfn mrhb steps totalAVERAGE  0.5   1  1008
AVERAGE  0.5  12  4320MIN  0.5  12  4320MAX  0.5  12  4320
AVERAGE  0.5 144   720MAX  0.5 144   720MIN  0.5 144   720*** Presentation ***
charset = utf-8
template = /usr/local/smokeping/etc/basepage.html.dist+ chartsmenu = 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+ detailwidth = 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 ***+ TCPPingbinary = /usr/bin/tcpping
forks = 5
offset = 50%
step = 300
#tcptraceroute = -e "sudo /usr/bin/tcptraceroute"
timeout = 15*** Slaves ***
secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
+boomer
display_name=boomer
color=0000ff+slave2
display_name=another
color=00ff00*** Targets ***probe = TCPPingmenu = 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.+ mytargetmenu = TestTCP
title = TestTCP
host = 82.223.245.88
pings = 5
port = 80

参考文章: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. TVM优化c++部署实践

    TVM优化c++部署实践 使用TVM导入神经网络模型: 模型支持pytorch , tensorflow , onnx, caffe 等.平时pytorch用的多,这里给一种pytorch的导入方式. ...

  2. 容器化部署实践之Django应用部署(二)

    上一篇文章有些同学感觉不够详细理解起来有些困难,我再来简单解释一下. 我们在开发的情况下:     浏览器请求→ python manage.py runserver(比如8000) → 到应用代码( ...

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

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

  4. centos 安装mysql5.7_Zabbix 4.2.5 安装部署实践详解

    [导读]云计算背景下,无论是大数据.物联网还是边缘计算,规模化后大量的设备需要保证正常运行,在人员一定的情况下,就需要提高运行维护效率.同时随着智能化被应用在人们生活的方方面面,关联性也越来越紧密,即 ...

  5. smokeping部署安装

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

  6. 网易云海外推流部署实践

    谈到直播,实时性和流畅性一直是整个服务体系中的重中之重.本文是网易云通信视频技术开发工程师何荣光在LiveVideoStack Meet杭州站沙龙的分享,着重梳理网易云在海外推流方面的部署实践,帮助开 ...

  7. tftp 服务器 ip_360Stack裸金属服务器部署实践

    女主宣言 裸金属特性是一种将物理设备作为资源提供给租户的云计算服务,租户通过该服务可申请.管理和配置相应的物理设备资源,本文将介绍360Stack裸金属服务器的部署实践. PS:丰富的一线技术.多元化 ...

  8. 阿里P8架构师谈:Quartz调度框架详解、运用场景、与集群部署实践

    以下将分别从Quartz架构简介.集群部署实践.Quartz监控.集群原理分析详解Quartz任务调度框架. Quartz简介 Quartz是Java领域最著名的开源任务调度工具,是一个任务调度框架, ...

  9. 时空大数据实践之GeoWave安装部署实践

    2019独角兽企业重金招聘Python工程师标准>>> 时空大数据实践之GeoWave安装部署实践 GeoWave是由国家地理空间情报局(NGA)与RadiantBlue和Booz ...

最新文章

  1. OSS控制台集成将数据库实时备份到OSS的功能
  2. 二叉树的层序遍历和二叉树的线索化
  3. Android 8.1 源码_启动篇(一) -- 深入研究 init(转 Android 9.0 分析)
  4. 实验中遇到的Quartus II的Warning的解释、原因以及解决方法
  5. IOS 程序猿 UITbleView 篇
  6. utf8 and unicode
  7. setCharacterEncoding和setContentType
  8. python在哪个城市工资高_专硕好还是学硕好?哪个更好就业工资高?
  9. canvas笔记-closePath函数的使用(含例子)
  10. JavaScript性能优化【中】-- Performance 工具
  11. 在TypeScript中使用React钩子
  12. oracle把一列更新为空,ORA-01439:要更改数据类型,则要修改的列必须为空
  13. MTK驱动移植相关路径
  14. android黑域系统文件,优雅地使用安卓手机,黑域免root使用教程
  15. 雷达图使用攻略(上)
  16. CCS导入工程时报错“overlaps the location of another project”解决办法
  17. 毛玻璃效果 php,CSS3教程之制作倾斜导航条和毛玻璃效果
  18. 希尔顿与锦江集团续签合作协议,将在华开逾600家希尔顿欢朋酒店
  19. 关于下拉框select和option默认值选定
  20. 《c语言程序设计》实验报告,C语言程序设计实验实验报告_wenkub

热门文章

  1. html中做用户输入的判断
  2. Java 攻城狮面试题 06_Spring Cloud 微服务
  3. 托福、雅思、托业、剑桥:英语证书谁领风骚?
  4. 松柏先生:电商的这六道死穴不解开,就等死吧!
  5. java jsp网页新闻_JSP新闻显示
  6. ssm户外用品商城 毕业设计源码112346
  7. $ajax textstatus报错parsererror
  8. 开发中的WebApp框架Demo
  9. php mergecells,合并单元格的PHPExcel setAutoSize
  10. JavaScript优雅的跳转,作弊跳转方式,JS防检测跳转。