写在文前,不喜勿喷:
最近现网变更有点多,在网络及配置变更中,拨测这个很重要,面对错综复杂的网络环境,通过拨测可以发现和解决网络问题,优化网络性能和提高用户体验,从而保证企业网络的稳定性和可靠性。今天也是纯粹的分享,常用的拨测老工具Smokeping,Smokeping是一款用于网络性能监测的开源监控软件,主要用于对IDC的网络状况,网络质量,稳定性等做检测,部署需要的资源不多,正常运行的话仅需 128 MB 左右的内存,配置也是简单灵活。
废话就不多说,我这边先给大家打个样,需求不同,有兴趣的可以百度下。
操作环境
系统:kali2023.4
更换yum国内源
docker快速部署smokeping服务
安装docker服务
yum –y install docker
启动docker服务
systemctl start docker
创建服务器本地映射目录
mkdir -p /data/smokeping
拉取最新的smokeping镜像
docker pull linuxserver/smokeping
创建一个smokeping的docker服务并映射相关目录
docker create --name=smokeping -e TZ=Asia/Shanghai -p 80:80 --restart unless-stopped -v /data/smokeping/data:/data -v /data/smokeping/config:/config linuxserver/smokeping
启动docker
docker start smokeping
访问页面:http://XX.XX.XX.XX:80
初始页面:
部署完成
smokeping配置调优
(1)监控的频率和探针数量修改:
vi /data/smokeping/config/Database
step = 60
pings = 20
这里我们将监控周期改为1分钟,探针数量20
(2)Presentation设置
Presentation 主要是 smokeping 的图表和第一栏的设置
template = /etc/smokeping/basepage.html
charset = utf-8 #支持utf-8所以可以汉化一部分
+ charts # 以下为第一栏内容,纯图方便,只个人看着懂意思.
menu = 排行榜
title = 排行榜
++ stddev
sorter = StdDev(entries=>4)
title = 综合指数排行
menu = 综合指数
format = 综合指数 %f
++ max
sorter = Max(entries=>5)
title = 最大延迟
menu = 最大延迟
format = 最大延迟时间 %f 秒
++ loss
sorter = Loss(entries=>5)
title = 丢包率
menu = 丢包率
format = 丢包 %f
++ median
sorter = Median(entries=>5)
title = 中间数据包延迟
menu = 中间数据包延迟
format = 中间数据包延迟 RTT %f 秒
+ overview
width = 600
height = 50
range = 10h
+ detail
width = 600
height = 200
unison_tolerance = 2
# 图表横坐标,这里改为 1小时,1天,10天,360天,更符合习惯.
"Last 1 Hours" 1h
"Last 24 Hours" 24h
"Last 10 Days" 10d
"Last 360 Days" 360d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
(3)Targets监控配置
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of WORKS Company. \
Here you will learn all about the latency of our network.
+ network_ping
menu = network ping
title = network ping
++ gateway
menu = 10.153.1.1
title = 10.153.1.1
host = 10.153.1.1
++ heduohao_BF
menu = heduohao_BF_10.2.75.130
title = heduohao_BF_10.2.75.130
host = 10.2.75.130
++ ziyaunchi_BF
menu = ziyuanchi_BF_10.2.3.4
title = ziyuanchi_BF_10.2.3.4
host = 10.2.3.4
++ ziyaunchi_LG
menu = ziyaunchi_LG_10.3.1.32
title = ziyaunchi_LG_10.3.1.32
host = 10.3.1.32
++ CaiYun_BF_A
menu = CaiYun_BF_10.2.78.1
title = CaiYun_BF_10.2.78.1
host = 10.2.78.1
+ network_tcpping
menu = network tcpping
title = network tcpping
++ heduohao_BF_A
menu = BF_heduohao_10.2.75.130_22
title = BF_heduohao_10.2.75.130_22
probe = TCPPing
host = 10.2.75.130
pings = 40
port = 22
++ heduohao_BF_B
menu = BF_heduohao_10.2.75.130_35001
title = BF_heduohao_10.2.75.130_35001
probe = TCPPing
host = 10.2.75.130
pings = 40
port = 35001
成果图
|