We will introduce how to introduce a tool called Smokeping that measures and visualizes network latency. You can analyze the latency of the server you want to measure like this and the fluctuation width along with the time axis.
If it is UTC time, the time displayed by Smokeping will also be UTC, so change it to Japan time. The current setting is UTC.
[opc@smokeping ~]$ timedatectl
Local time: Sun 2020-11-22 14:27:46 GMT
Universal time: Sun 2020-11-22 14:27:46 UTC
RTC time: Sun 2020-11-22 14:27:46
Time zone: GMT (GMT, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
[opc@smokeping ~]$
Change to Japan time.
sudo timedatectl set-timezone Asia/Tokyo
It has been changed to JST.
[opc@smokeping ~]$ timedatectl
Local time: Sun 2020-11-22 23:28:15 JST
Universal time: Sun 2020-11-22 14:28:15 UTC
RTC time: Sun 2020-11-22 14:28:14
Time zone: Asia/Tokyo (JST, +0900)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
[opc@smokeping ~]$
Since this environment is configured with Public Cloud (Oracle Cloud), the firewall function is enabled on the Public Cloud side. Firewalld inside CentOS will be stopped.
sudo systemctl stop firewalld
sudo systemctl disable firewalld
Smokeping Install
Install Smokeping from EPEL
sudo yum -y install smokeping
httpd is also automatically installed as a dependency, and the file for Smokeping is also automatically generated
[opc@smokeping ~]$ cat /etc/httpd/conf.d/smokeping.conf
<Directory "/usr/share/smokeping" >
Require local
# Require ip 2.5.6.8
# Require host example.org
</Directory>
<Directory "/var/lib/smokeping" >
Require local
# Require ip 2.5.6.8
# Require host example.org
</Directory>
# .fcgi : smokeping by mod_fcgid aka fastcgi
# _cgi : plain old fashion cgi
ScriptAlias /smokeping/sm.cgi /usr/share/smokeping/cgi/smokeping.fcgi
#ScriptAlias /smokeping/sm.cgi /usr/share/smokeping/cgi/smokeping_cgi
Alias /smokeping/images /var/lib/smokeping/images
Alias /smokeping /usr/share/smokeping/htdocs
[opc@smokeping ~]$
Edit
sudo vim /etc/httpd/conf.d/smokeping.conf
By default, it is only local, so set the authority so that everyone can see it.
<Directory "/usr/share/smokeping" >
Require all granted
</Directory>
<Directory "/var/lib/smokeping" >
Require all granted
</Directory>
# .fcgi : smokeping by mod_fcgid aka fastcgi
# _cgi : plain old fashion cgi
ScriptAlias /smokeping/sm.cgi /usr/share/smokeping/cgi/smokeping.fcgi
#ScriptAlias /smokeping/sm.cgi /usr/share/smokeping/cgi/smokeping_cgi
Alias /smokeping/images /var/lib/smokeping/images
Alias /smokeping /usr/share/smokeping/htdocs
Restart Apache and Smokeping
sudo systemctl restart httpd
sudo systemctl restart smokeping
If you rewrite the IP address and access the following URL, the page of the next image will be displayed. http://ipaddress/smokeping/sm.cgi
Smokeping sets the target for measuring network latency.
sudo vim /etc/smokeping/config
Here is an excerpt from some of the original settings.
*** Targets ***
#menuextra = <a target='_blank' href='/smokeping/tr.html{HOST}' class='{CLASS}' \
# onclick="window.open(this.href,this.target, \
# 'width=800,height=500,toolbar=no,location=no,status=no,scrollbars=no'); \
# return false;">*</a>
#
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of <b>Insert Company Name Here</b>. \
Here you will learn all about the latency of our network.
+ Ping
menu = Fedora
title = Fedora Pings
++ FedoraprojectOrg
menu = fedoraproject.org
title = Fedora Webserver
host = fedoraproject.org
++ DocsFedoraprojectOrg
menu = docs.fedoraproject.org
title = Fedora Docs Webserver
host = docs.fedoraproject.org
++ PlanetFedora
menu = planet.fedoraproject.org
title = Planet Fedora
host = planet.fedoraproject.org
After change
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of <b>Insert Company Name Here</b>. \
Here you will learn all about the latency of our network.
+ Ping
menu = OCI
title = OCI Pings
++ win-e2
menu = win-e2
title = win-e2
host = 10.0.0.5
++ win-e3
menu = win-e3
title = win-e3
host = 10.0.0.6
++ win-intel
menu = win-intel
title = win-intel
host = 10.0.0.7
++ win-e2-to-e3-paravirtual
menu = win-e2-to-e3-paravirtual
title = win-e2-to-e3-paravirtual
host = 10.0.0.10
++ win-e2-to-e3-vfio
menu = win-e2-to-e3-vfio
title = win-e2-to-e3-vfio
host = 10.0.0.11
++ linux-e3
menu = linux-e3
title = linux-e3
host = 10.0.0.8
++ metadata
menu = metadata
title = metadata
host = 169.254.169.254
You can also change the Ping execution interval. In my case, I wanted to measure the Ping result in detail, so I try to ping three times every three seconds. (If you set it every 1 second, an error will occur)
--step: How many seconds interval --pings: Number of pings to execute (minimum 3)
*** Database ***
step = 3
pings = 3
Reflect
sudo systemctl restart smokeping
sudo systemctl restart httpd
Error
Depending on the settings, the following error may occur.
Error: RRD parameter mismatch ('Wrong value of step: /var/lib/smokeping/rrd/Ping/e2-to-e3.rrd has 300, create string has 299'). You must delete /var/lib/smokeping/rrd/Ping/e2-to-e3.rrd or fix the configuration parameters.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
https://smokeping-users.oetiker.narkive.com/QYblo4YW/rrd-parameter-mismatch-wrong-value-of-step
In such a case, it is OK to delete the past RDD file.
rm -f /var/lib/smokeping/rrd/Ping/*
Let's restart the service after deleting
systemctl restart smokeping
systemctl restart httpd
Smokeping automatically reloads the web browser page. It depends on the setting, but it is automatically updated every 3 seconds, which is very worrisome.
You can stop the automatic update by editing the following file.
vim /etc/smokeping/basepage.html
Deleted the 8th line
<META HTTP-EQUIV="Refresh" CONTENT="<##step##>">
Service restart
systemctl restart smokeping
systemctl restart httpd
Top Page https://oss.oetiker.ch/smokeping/
How to Install https://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html
How to Install https://www.qoosky.io/techs/4c3f3ab25f
How to Install https://qiita.com/makotaka/items/7a6cb91b78562b97ca03
How to track network delays using SmokePing on FreeBSD 11 https://www.codeflow.site/ja/article/how-to-track-network-latency-with-smokeping-on-freebsd-11
[Memo] Latency visualization started with SmokePing (1) Introduction http://pocketstudio.jp/log3/2012/04/24/smokeping/
[Memo] Latency visualization with SmokePing (2) DNS & HTTP response http://pocketstudio.jp/log3/2012/04/26/smokeping_dns_and_http_latency/
How to read the graph of SmokePing https://oss.oetiker.ch/smokeping/doc/reading.en.html
Recommended Posts