Written in front
- I thought I would never use smokeping again, but I was wrong.
- According to the last use for about half a year, it's usually used once for sex and again this time. I totally forgot to clean it.
Then start
install
apt-get -y install smokeping
Configuration service
- For the configuration of the Web server, refer to the above Running Shell script with Nginx.
- It is recommended to keep the startup user configured in / etc / init.d/smoking consistent with Nginx. Take www data as an example:
# /etc/init.d/smokeping
DAEMON_USER=www-data
- The effect of running out is as follows:
Data configuration
- Page template / etc / smoking / basepage.html, where the variables are from / etc / smoking / config.d/general.
- The storage path of the data file is in / etc / smoking / config.d/pathnames. Remember to correct the directory permissions when changing the path.
# /etc/smokeping/config.d/pathnames
sendmail = /usr/sbin/sendmail
imgcache = /data/smokeping/htdocs/images
imgurl = images
datadir = /data/smokeping/libdata
piddir = /var/run/smokeping
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
- The referenced configuration is specified in the main configuration file / etc / smoking / config. The monitoring tasks of HTTP and Ping are added as follows:
# /etc/smokeping/config
@include /etc/smokeping/config.d/General
@include /etc/smokeping/config.d/Alerts
@include /etc/smokeping/config.d/Database
@include /etc/smokeping/config.d/Presentation
@include /etc/smokeping/config.d/Probes
@include /etc/smokeping/config.d/Slaves
@include /etc/smokeping/config.d/Targets
@include /etc/smokeping/config.d/HTTP
@include /etc/smokeping/config.d/Ping
- Add a Ping probe / etc / smoking / config.d/Ping:
+ demo-intranet-fping
probe = FPing
menu = Core computer room Fping Intranet
title = Intranet of computer room Ping
++ demo-bfs-01
menu = demo-bfs-01
title = demo-ops-lvs-02 -> 192.168.1.1
host = 192.168.1.1
++ demo-cache-01
menu = demo-cache-01
title = demo-ops-lvs-02 -> 192.168.1.5
host = 192.168.1.5
++ demo-k8s-master-01
menu = demo-k8s-master-01
title = demo-ops-lvs-02 -> 192.168.1.32
host = 192.168.1.32
- Add an independent HTTP monitoring, / etc / smoking / config.d/http:
+ kisjd-http-curl
probe = Curl
menu = Monitor HTTP response time
title = Test out the network HTTP Access speed
++ baidu
menu = baidu.com
title = www.baidu.com
host = www.baidu.com
++ bilibili
menu = bilibili.com
title = www.bilibili.com
host = www.bilibili.com
++ youku
menu = youku.com
title = www.youku.com
host = www.youku.com
++ iqiyi
menu = iqiyi.com
title = www.iqiyi.com
host = www.iqiyi.com
- The detection method is specified in the configuration file / etc / smoking / config.d/probes, for example:
*** Probes ***
+ AnotherSSH
forks = 24
offset = 90%
greeting = SSH-2.0-OpenSSH_Smokeping
interval = complete
mininterval = 0.8
+ Curl
binary = /usr/bin/curl
forks = 24
offset = 90%
agent = User-Agent: Smokeping/2.6.9
expect = OK
extraargs = -4 --head
extrare = / /
follow_redirects = no
include_redirects = no
insecure_ssl = 1
interface = bond0
timeout = 20
urlformat = http://%host%/
+ FPing
binary = /usr/bin/fping
blazemode = true
hostinterval = 1.5
mininterval = 0.001
offset = 50%
packetsize = 5000
pings = 20
sourceaddress = 10.130.1.73
step = 300
timeout = 1.5
tos = 0x20
usestdout = true
- The default overview is set in the configuration file / etc / smoking / config.d/presentation. The multi-dimensional data is added as follows for reference:
# /etc/smokeping/config.d/Presentation
*** Presentation ***
template = /etc/smokeping/basepage.html
charset = utf-8
+ charts
menu = Quality ranking
title = Worst quality leaderboards
++ stddev
sorter = StdDev(entries=>4)
title = Response time variance ranking - top4
menu = Response time variance
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Maximum response time ranking - top5
menu = Maximum response time
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Worst stable ranking - top5
menu = stability
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Ranking with the worst average response time - top5
menu = Average response time
format = Median RTT %f seconds
+ overview
width = 800
height = 50
range = 24h
+ detail
width = 800
height = 200
unison_tolerance = 2
"Last 5 minutes" 5m
"Last 10 minutes" 10m
"Last 30 minutes" 30m
"Last 1 Hours" 1h
"Last 3 Hours" 3h
"Last 12 Hours" 12h
"Last 1 Days" 1d
"Last 7 Days" 7d
"Last 30 Days" 30d
- OK, that's all. For new installation