$ cat Targets
*** Targets ***
probe = FPing
menu = Top
title = 51SEC Network Latency Grapher
remark = Welcome to the 51SEC SmokePing website. \
Here you will know all about the latency of our network.
+ NETSECSites
menu = 51SEC Sites
title = 51SEC Sites
++ 51sec
menu = 51sec.org
title = 51sec
host = 51sec.org
++ itprosec
menu = itprosec.com
title = itprosec
host = itprosec.com
+ DNS
menu = DNS
title = DNS
++ GoogleDNS1
menu = Google DNS 1
title = Google DNS 8.8.8.8
host = 8.8.8.8
++ GoogleDNS2
menu = Google DNS 2
title = Google DNS 8.8.4.4
host = 8.8.4.4
++ OpenDNS1
menu = OpenDNS1
title = OpenDNS1
host = 208.67.222.222
++ OpenDNS2
menu = OpenDNS2
title = OpenDNS2
host = 208.67.220.220
++ CloudflareDNS1
menu = Cloudflare DNS 1
title = Cloudflare DNS 1.1.1.1
host = 1.1.1.1
++ CloudflareDNS2
menu = Cloudflare DNS 2
title = Cloudflare DNS 1.0.0.1
host = 1.0.0.1
++ L3-1
menu = Level3 DNS 1
title = Level3 DNS 4.2.2.1
host = 4.2.2.1
++ L3-2
menu = Level3 DNS 2
title = Level3 DNS 4.2.2.2
host = 4.2.2.2
++ Quad9
menu = Quad9
title = Quad9 DNS 9.9.9.9
host = 9.9.9.9
+ DNSProbes
menu = DNS Probes
title = DNS Probes
probe = DNS
++ GoogleDNS1
menu = Google DNS 1
title = Google DNS 8.8.8.8
host = 8.8.8.8
++ GoogleDNS2
menu = Google DNS 2
title = Google DNS 8.8.4.4
host = 8.8.4.4
++ OpenDNS1
menu = OpenDNS1
title = OpenDNS1
host = 208.67.222.222
++ OpenDNS2
menu = OpenDNS2
title = OpenDNS2
host = 208.67.220.220
++ CloudflareDNS1
menu = Cloudflare DNS 1
title = Cloudflare DNS 1.1.1.1
host = 1.1.1.1
++ CloudflareDNS2
menu = Cloudflare DNS 2
title = Cloudflare DNS 1.0.0.1
host = 1.0.0.1
++ L3-1
menu = Level3 DNS 1
title = Level3 DNS 4.2.2.1
host = 4.2.2.1
++ L3-2
menu = Level3 DNS 2
title = Level3 DNS 4.2.2.2
host = 4.2.2.2
++ Quad9
menu = Quad9
title = Quad9 DNS 9.9.9.9
host = 9.9.9.9
+CurlHTTPS
menu = Remote HTTPS Response
title = HTTPS Response Remote Machines
++google
menu = Google
title = Google.com HTTPS response time
probe = Curl
host = http://www.google.org/
++nsrc
menu = Network Startup Resource Center
title = nsrc.org HTTPS response time
probe = Curl
host = http://nsrc.org/
++facebook
menu = Network Startup Resource Center
title = Facebook HTTPS response time
probe = Curl
host = http://www.facebook.com/
Once you are done, save and exit from the Targets file and verify your work:
Simple explanation:
- ++ Fill in the identifier here, which can be uppercase and lowercase letters, numbers, underscores, and hyphens.
- menu = The content displayed in the menu.
- title = The content displayed at the top of the page.
- host = The target to ping, can be a domain name or IP address.
- Restart the container after making any changes to the configuration file.
Modify The Node Name
Add a display_name
*** General ***
owner = LinuxServer.io
contact = [email protected]
mailhost = my.mail.host
cgiurl = http://localhost/smokeping.cgi
syslogfacility = local0
# Save space, removed comments
display_name = Zhengzhou Mobile Broadband # Here
@include /config/pathnames
Customize the query frequncy
First, customize the query frequency:
cd ~/myserve/smokeping && vim config/Database
*** Database ***
step = 180
pings = 20
Query 20 times every 3 minutes.
- step: Query cycle in seconds, how many seconds to ping in one cycle, not just ping, it refers to the operation of all probes
- pings: How many times to query in each cycle, for example, how many pings for each node
Edit the probe configuration file:
cd ~/myserve/smokeping && vim config/Probes
The commonly used ones are:
*** Probes ***
+ FPing
binary = /usr/sbin/fping
packetsize = 1000
+ FPing6
binary = /bin/ping6 # This cannot be changed according to the official website because it is the container version
+ DNS
binary = /usr/bin/dig
lookup = baidu.com
pings = 5
step = 300
+ Curl
binary = /usr/bin/curl
forks = 5
offset = 50%
Change probe type to use a specific probe
You can change the probe type in the configuration file to use a specific probe. Add probe = probe_name
at the beginning of the line to specify which probe to use.
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to this SmokePing website.
+ services
menu = Service latency
title = Service latency (DNS, HTTP)
++ DNS
probe = DNS # Change probe to DNS here
menu = DNS latency
title = Service latency (DNS)
+++ dns1
host = dns1.example
Manual Install Smokeping
Ubuntu OS:
apt update -y
apt install smokeping -y
http://<public ip>/smokeping
root@instance-20240705-213604:/# cd /etc/smokeping/config.d/
root@instance-20240705-213604:/etc/smokeping/config.d# ls
Alerts Database General Presentation Probes Slaves Targets pathnames
root@instance-20240705-213604:/etc/smokeping/config.d#
Probes configuration file:
root@instance-20240705-213604:/etc/smokeping/config.d# cat Probes
*** Probes ***
+ FPing
binary = /usr/bin/fping
+ DNS
binary = /usr/bin/dig
lookup = google.com
pings = 5
step = 300
+EchoPingHttp
binary = /usr/bin/echoping
forks = 5
offset = 50%
step = 300
port = 80
url = /
+EchoPingHttps
binary = /usr/bin/echoping
forks = 5
offset = 50%
step = 300
port = 443
url = /
Targets configuration file:
root@instance-20240705-213604:/etc/smokeping/config.d# cat Targets
*** Targets ***
probe = FPing
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.
+ NETSECSites
menu = 51SEC Sites
title = 51SEC Sites
++ 51sec
menu = 51sec.org
title = 51sec
host = 51sec.org
++ itprosec
menu = itprosec.com
title = itprosec
host = itprosec.com
+EPingHttpHttps
menu = HTTP HTTPS Response
title = HTTP HTTP Response Remote
++google
menu = Google HTTP
title = Google.org HTTPS response time
probe = EchoPingHttp
host = www.google.org
url = /
accept_redirects = yes
++nsrc
menu = NSRC HTTPS
title = nsrc.org HTTPS response time
probe = EchoPingHttps
host = nsrc.org
url = /
accept_redirects = yes
++MSN
menu = MSN HTTPS
title = MSN HTTPS response time
probe = EchoPingHttps
host = www.msn.com
url = /
accept_redirects = yes
+ DNS
menu = DNS
title = DNS
++ GoogleDNS1
menu = Google DNS 1
title = Google DNS 8.8.8.8
host = 8.8.8.8
++ GoogleDNS2
menu = Google DNS 2
title = Google DNS 8.8.4.4
host = 8.8.4.4
++ OpenDNS1
menu = OpenDNS1
title = OpenDNS1
host = 208.67.222.222
+ Local
menu = Local
title = Local Network
#parents = owner:/Test/James location:/
++ LocalMachine
menu = Local Machine
title = This host
host = localhost
#alerts = someloss
System comands:
- systemctl restart smokeping
- systemctl start smokeping
- systemctl status smokeping.service
- journalctl -xeu smokeping.servic
Configuration file location: /etc/smokeping/config.d/
Database file location: /var/lib/smokeping/DNS
Further docker commands can be found from : https://blog.51sec.org/2020/04/docker-usage.html
Install echoping
Ubuntu
Fixed the issue not able to install echoping in Ubuntu, by using the packages from Ubuntu 18.04LTS:
root@instance-20240705-213604:/etc/smokeping/config.d# echoping -C -v -h /smokeping www.51sec.org
This is echoping, version 6.0.2.
Trying to connect to internet address 172.67.181.8 443 to transmit 99 bytes…
Trying to send 256 bytes to internet address 172.67.181.8…
Connected…
TCP Latency: 0.013837 seconds
Cannot start the TLS session: A TLS fatal alert has been received. (Network is unreachable)
root@instance-20240705-213604:/etc/smokeping/config.d# echoping -R -v -h /smokeping www.51sec.org
This is echoping, version 6.0.2.
Trying to connect to internet address 104.21.83.198 80 to transmit 95 bytes…
Trying to send 256 bytes to internet address 104.21.83.198…
Connected…
TCP Latency: 0.015713 seconds
Sent (95 bytes)…
Application Latency: 0.906786 seconds
HTTP error “HTTP/1.1 404 Not Found
“
root@instance-20240705-213604:/etc/smokeping/config.d#
echoping -C -v -h / www.google.com
Debian
Install dig for DNS
In certain Linux OS release, dig program might not include. Here is a command to install dig application.
After installed it, you can find it from /usr/bin folder.
Troubleshooting
root@3d598822f424:/# smokeping –config=”/etc/smokeping/config” –debug
WARNING: Hostname ‘ipv6.google.com’ does currently not resolve to an IPv4 address
WARNING: Hostname ‘ipv6.google.com’ does currently not resolve to an IPv4 address
Curl: Note: your curl doesn’t support the interface feature (option –interface), disabling it
Curl: Note: your curl doesn’t support the timeout feature (option -m), disabling it
### parsing dig output…OK
### assuming you are using an tcpping copy reporting in milliseconds
### assuming you are using an fping copy reporting in milliseconds
### Compiling alert detector pattern ‘someloss’
### >0%,*12*,>0%,*12*,>0%
sub {
my $d = shift;
my $y = $d->{loss};
for(1){
my $imax2 = min(@$y – 3, 12);
my $imax1 = min(@$y – 3, 12);
my $minlength = 3;
my $maxlength = 27;
next if scalar @$y < $minlength ;
my $i1;
for($i1=0; $i1 < min($maxlength,$imax1); $i1++){
my $i2;
for($i2=0; $i2 < min($maxlength-$i1,$imax2); $i2++){
next unless defined $y->[-3-$i1-$i2]
and $y->[-3-$i1-$i2] =~ /^\d/
and $y->[-3-$i1-$i2] > 0
; last;
}
return 0 if $i2 >= min($maxlength-$i1-$i2,$imax2);
next unless defined $y->[-2-$i1]
and $y->[-2-$i1] =~ /^\d/
and $y->[-2-$i1] > 0
; last;
}
return 0 if $i1 >= min($maxlength-$i1,$imax1);
next unless defined $y->[-1]
and $y->[-1] =~ /^\d/
and $y->[-1] > 0
; return 1;
}
return 0;
}
Smokeping version 2.008002 successfully launched.
Not entering multiprocess mode with ‘–debug’. Use ‘–debug-daemon’ for that.
DNS: probing 9 targets with step 300 s and offset 87 s.
Curl: probing 0 targets with step 300 s and offset 87 s.
TCPPing: probing 0 targets with step 300 s and offset 87 s.
FPing: probing 26 targets with step 300 s and offset 87 s.
FPing6: probing 1 targets with step 300 s and offset 87 s.
DNS: forks 5, timeout for each target 26
DNS: query=/usr/bin/dig @1.0.0.1 google.com
DNS: query=/usr/bin/dig @4.2.2.2 google.com
DNS: query=/usr/bin/dig @9.9.9.9 google.com
DNS: query=/usr/bin/dig @8.8.8.8 google.com
DNS: query=/usr/bin/dig @8.8.4.4 google.com
DNS: 9.9.9.9: got 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03 7.0000000000e-03 7.0000000000e-03
DNS: 8.8.8.8: got 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03 3.0000000000e-03 7.0000000000e-03
DNS: 1.0.0.1: got 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03 3.0000000000e-03 1.1000000000e-02
DNS: 4.2.2.2: got 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 3.0000000000e-03
DNS: 8.8.4.4: got 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03
DNS: query=/usr/bin/dig @208.67.220.220 google.com
DNS: query=/usr/bin/dig @4.2.2.1 google.com
DNS: query=/usr/bin/dig @208.67.222.222 google.com
DNS: query=/usr/bin/dig @1.1.1.1 google.com
DNS: 1.1.1.1: got 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 3.0000000000e-03 7.0000000000e-03
DNS: 208.67.222.222: got 3.0000000000e-03 3.0000000000e-03 7.0000000000e-03 1.1000000000e-02 1.1000000000e-02
DNS: 4.2.2.1: got 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03
DNS: 208.67.220.220: got 0.0000000000e+00 3.0000000000e-03 3.0000000000e-03 1.1000000000e-02 1.9000000000e-02
FPing: Executing /usr/sbin/fping -C 20 -q -B1 -r1 -i10 www.berkeley.edu cam.ac.uk 208.67.222.222 web.mit.edu ucsd.edu www.indiana.edu osuosl.org facebook.com youtube.com 208.67.220.220 8.8.8.8 4.2.2.1 8.8.4.4 1.0.0.1 www.telefonica.de twin-cities.umn.edu jupiterbroadcasting.com cixp.web.cern.ch google.com 9.9.9.9 1.1.1.1 www.uea.ac.uk linuxserver.io 4.2.2.2
^Cgot INT signal, terminating.
root@3d598822f424:/#
Issue
Modify the resolve.conf file in the image. Perform all operations in the ~/myserve/smokeping/
directory with the following steps:
Create a custom resolve.conf file: Add a usable DNS server in China, here we use 223.5.5.5
touch resolve.conf && \
echo "nameserver 223.5.5.5" > resolve.conf && \
echo "options edns0 trust-ad ndots:0" >> resolve.conf
Create a Dockerfile to pull and modify the image:
cat > Dockerfile << EOF
FROM linuxserver/smokeping:latest
COPY ./resolve.conf /etc/resolve.conf
EOF
Change the docker-compose.yml file to the following content, replacing image:
with build:
:
cat > docker-compose.yml << EOF
version: "2.1"
services:
smokeping:
build: ./
container_name: smokeping
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Shanghai
volumes:
- ./config:/config
- ./data:/data
ports:
- 8899:80
EOF
docker compose up -d
Leave a Reply