Smokeping is a nifty tool that continuously performs network measurements (such as ICMP ping tests) and graphs the results in a web interface. It can help you assess performance and detect issues in not only your own but also upstream networks.
This article details setup steps for running Smokeping in a systemd-nspawn container with some additional requirements:
IPv6 probes must work
The container will directly use the host network so that no routing, NAT or address assignment needs to be set up.
To reduce disk and runtime footprint the container will run Alpine Linux
Next we'll boot into the container to configure everything:
systemd-nspawn -b -M smokeping -U
touch /etc/network/interfacesso that the network initscript can start up later (even though there is nothing to configure).
Install all required packages:
apk add smokeping fping lighttpd ttf-dejavu
Make sure that fping works by running e.g.
If this does not work you need to configure the host to allow unprivileged pings.
This is done by setting the following sysctl:
net.ipv4.ping_group_range=0 2147483647 (usually by editing /etc/sysctl.conf)
Also note that Alpine Linux must be 3.13 or newer for this to work 1.
Next is the lighttpd configuration inside /etc/lighttpd.
Get rid of all the examples:
mv lighttpd.conf lighttpd.conf.bak && grep -v '^#' lighttpd.conf.bak | uniq >lighttpd.conf
There are multiple changes to be done in lighttpd.conf:
server.groupname = "smokeping", the CGI process will need access to smokeping's files.
server.port = 8081and
server.use-ipv6 = "enable"
configure mod_fastcgi for Smokeping by appending the following:
server.modules += ("mod_fastcgi") fastcgi.server = ( ".cgi" => (( "bin-path" => "/usr/share/webapps/smokeping/smokeping.cgi", "socket" => "/tmp/smokeping-fastcgi.socket", "max-procs" => 1, )), )
We also need to link smokeping's files into the webroot:
ln -s /usr/share/webapps/smokeping/ /var/www/localhost/htdocs/smokeping
Next is the smokeping configuration located at /etc/smokeping/config.
cgiurl = http://your_server_here:8081/smokeping/smokeping.cgi
Smokeping's configuration 2 isn't super obvious if you haven't done it before so
I'll provide an example here (this replaces the
*** Probes *** + FPing binary = /usr/sbin/fping + FPing6 binary = /usr/sbin/fping *** Targets *** probe = FPing menu = Top title = Network Latency Grapher remark = + targets menu = IPv4 targets ++ google menu = Google title = Example Target: Google (IPv4) host = 22.214.171.124 + targets6 menu = IPv6 targets probe = FPing6 ++ google menu = Google title = Example Target: Google (IPv6) host = 2001:4860:4860::8844
Lastly, grant the CGI process write access to the image folder:
chmod g+w /var/lib/smokeping/.simg
Final container setup
rc-update add smokeping && rc-update add lighttpd
systemctl start systemd-nspawn@smokeping
PrivateUsers=noin the Exec section.
You can now visit
should see a mostly empty page with a sidebar containing "Charts",
"IPv4 targets" and "IPv6 targets" on the left.