SMOKEPING_MASTER_SLAVE(7)
π smokeping_master_slave β the master/slave glow-up
okay so this is smokeping_master_slave(7), aka the page that teaches you how to run a whole little squad of distributed SmokePing instances, and honestly? it's giving main character energy. bestie, let's get into it π«Ά
πΈ NAME πΈ
smokeping_master_slave β literally how to run multiple distributed instances of SmokePing β¨
π¦ OVERVIEW π¦
so normally, smokeping probes run their tests from the host where smokeping runs to some target host, and they monitor the latency of the connection between the two. that's the default vibe. π
the Master/Slave concept enables all smokeping probes to run remotely. the use case? measuring the overall connectivity in a network. like, if you're interested in checking that your central DNS server or your file server works for everyone, you could set up several smokeping instances checking up on the two servers from multiple locations within your network. with the Master/Slave smokeping configuration this process becomes much simpler, because one smokeping master server can control multiple slaves. lowkey iconic. π
all monitoring data is stored and presented on the server, but collected by the slaves. the slaves will also get their configuration information from the master, so you just have to maintain the master server configuration file and the rest is taken care of automatically. no cap, that's the whole point. π
β¨ DESCRIPTION β¨
π§ Architecture
the slaves communicate with the master smokeping server via the normal smokeping web interface. on initial startup each slave connects to the master server and asks for its assignments. when the slave has done a round of probing it connects to the master again to deliver the results. πββοΈπ¨
if the assignment for a slave changes, the master will tell the slave after the slave has delivered its results.
the master and the slaves sign their messages by supplying an HMAC-MD5 code (RFC 2104) of the message and a shared secret. optionally the whole communication can run over ssl. π
[slave 1] [slave 2] [slave 3]
| | |
+-------+ | +--------+
| | |
v v v
+---------------+
| master |
+---------------+
the slave is a normal smokeping instance setup where the configuration comes from the master instead of a local configuration file. the slave tries to contact the master server after every round of probing, supplying its results. if the master server can not be reached, the results will be sent to the server together with the next round of results. results will be stored in a file in Perl storable form so that they survive a restart of the smokeping instance. so like, your data is safe even if things get chaotic πβ¨
π Master Configuration
to configure a master/slave setup, add a slaves section to your smokeping configuration file. each slave has a section in the slaves part of the master configuration file. the section name must match the hostname of the slave. if some configuration parameter must be set to a special value for the slave, use an override section to configure this. π
the slave names must be the names the hosts think they have, not their outside hostnames or ip addresses or anything like that. when the slave calls the master to get its config or report its measurements it will tell the master its 'hostname'. this together with the shared secret is used to authenticate and identify who is who. iykyk π
*** Slaves ***
secrets=/etc/smokeping/slavesecrets.conf
+slave1
display_name=erul22
location=India
color=ff0000
++override
Probes.FPing.binary = /usr/bin/fping
...
then in the targets section you can define slaves at every level. again the settings get inherited by lower order targets and can be overwritten anywhere in the tree. π³
a slave will then get the appropriate configuration assigned by the server. periodt.
*** Targets ***
slaves = slave1 slave2
...
+dest1
slaves =
...
+dest2
slaves = slave1
...
+dest3
...
the data from the slaves will be stored in TargetName~SlaveName.rrd. so the example above would create the following files:
dest1.rrd
dest2.rrd
dest2~slave1.rrd
dest3.rrd
dest3~slave1.rrd
dest3~slave2.rrd
the slavesecrets.conf file contains a colon separated list of hostnames and secrets. π
host1:secret1
host2:secret2
π Slave Configuration
a smokeping slave setup has no configuration file. it just needs to know that it runs in slave-mode and its secret. the secret is stored in a file for optimal protection. by default the persistent data cache will be located in /tmp/smokeping.$USER.cache. πΎ
./smokeping --master-url=http://smokeping/smokeping.cgi \
--cache-dir=/var/smokeping/ \
--shared-secret=/var/smokeping/secret.txt
the secret.txt file contains a single word, the secret of this slave. it is NOT the same as the slavesecrets.conf file the master uses. do not mix them up bestie i'm begging π
π₯ SECURITY CONSIDERATIONS π₯
okay this part is serious, listen up. π
the master effectively has full access to slave hosts as the user running the slave smokeping instance. the configuration is transferred as Perl code that is evaluated on the slave. while this is done inside a restricted "Safe" compartment, there are various ways that a malicious master could embed arbitrary commands in the configuration and get them to run when the slave probes its targets. π
the strength of the shared secret is thus of paramount importance. brute forcing the secret would enable a man-in-the-middle to inject a malicious new configuration and compromise the slave. so pick a good secret. a really good one. ππ
π COPYRIGHT π
Copyright (c) 2007 by Tobias Oetiker, OETIKER+PARTNER AG. All right reserved.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
π«Ά AUTHOR π«Ά
Tobias Oetiker <tobi@oetiker.ch>
and that's the whole page bestie, slay π β¨
this has been SmokePing 2.9.0, dated 2025-06-30 β go forth and distribute your probes responsibly, mwah ππ
π¦ where this page comes from
- alpine 3.23: smokeping-doc 2.9.0-r1 Β· GPL-2.0-or-later
- alpine 3.24: smokeping-doc 2.9.0-r1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms