1SMOKEPING_MASTER_SLAVE(7) SmokePing SMOKEPING_MASTER_SLAVE(7)
2
3
4
6 smokeping_master_slave - How to run multiple distributed instances of
7 SmokePing
8
10 Normally smokeping probes run their tests from the host where smokeping
11 runs to some target host and monitor the latency of the connection
12 between the two.
13
14 The Master/Slave concept enables all smokeping probes to run remotely.
15 The use case for this is to measure the overall connectivity in a
16 network. If you are interested in checking that your central DNS server
17 or your file server works for everyone, you could setup several
18 smokeping instances checking up on on the two servers from multiple
19 locations within your network. With the Master/Slave smokeping
20 configuration this process becomes much simpler, as one smokeping
21 master server can control multiple slaves.
22
23 All monitoring data is stored and presented on the server, but
24 collected by the slaves. The slaves will also get their configuration
25 information from the master, so that you just have to maintain the
26 master server configuration file and the rest is taken care of
27 automatically.
28
30 Architecture
31 The slaves communicate with the master smokeping server via the normal
32 smokeping web interface. On initial startup each slave connects to the
33 master server and asks for its assignments. When the slave has done a
34 round of probing it connects to the master again to deliver the
35 results.
36
37 If the assignment for a slave changes, the master will tell the slave
38 after the slave has delivered its results.
39
40 The master and the slaves sign their messages by supplying an HMAC-MD5
41 code (RFC 2104) of the message and a shared secret. Optionally the
42 whole communication can run over ssl.
43
44 [slave 1] [slave 2] [slave 3]
45 | | |
46 +-------+ | +--------+
47 | | |
48 v v v
49 +---------------+
50 | master |
51 +---------------+
52
53 The slave is a normal smokeping instance setup where the configuration
54 comes from the master instead of a local configuration file. The slave
55 tries to contact the master server after every round of probing,
56 supplying its results. If the master server can not be reached, the
57 results will be sent to the server together with the next round of
58 results. Results will be stored in a file in Perl storable form so
59 that they survive a restart of the smokeping instance.
60
61 Master Configuration
62 To configure a master/slave setup, add a slaves section to your
63 smokeping configuration file. Each slave has a section in the slaves
64 part of the master configuration file. The section name must match the
65 hostname of the slave. If some configuration parameter must be set to a
66 special value for the slave, use an override section to configure this.
67
68 The slave names must be the names the hosts think they have, not their
69 outside hostnames or ip addresses or anything like that. When the slave
70 calls the master to get its config or report its measurements it will
71 tell the master its 'hostname'. This together with the shared secret is
72 used to authenticate and identify who is who.
73
74 *** Slaves ***
75 secrets=/etc/smokeping/slavesecrets.conf
76
77 +slave1
78 display_name=erul22
79 location=India
80 color=ff0000
81
82 ++override
83 Probes.FPing.binary = /usr/bin/fping
84 ...
85
86 Then in the targets section you can define slaves at every level. Again
87 the settings get inherited by lower order targets and can be
88 overwritten anywhere in the tree.
89
90 A slave will then get the appropriate configuration assigned by the
91 server.
92
93 *** Targets ***
94 slaves = slave1 slave2
95 ...
96 +dest1
97 slaves =
98 ...
99 +dest2
100 slaves = slave1
101 ...
102 +dest3
103 ...
104
105 The data from the slaves will be stored in TargetName~SlaveName.rrd. So
106 the example above would create the following files:
107
108 dest1.rrd
109 dest2.rrd
110 dest2~slave1.rrd
111 dest3.rrd
112 dest3~slave1.rrd
113 dest3~slave2.rrd
114
115 The slavesecrets.conf file contains a colon separated list of hostnames
116 and secrets.
117
118 host1:secret1
119 host2:secret2
120
121 Slave Configuration
122 A smokeping slave setup has no configuration file. It just needs to
123 know that it runs in slave-mode and its secret. The secret is stored in
124 a file for optimal protection. By default the persistent data cache
125 will be located in /tmp/smokeping.$USER.cache.
126
127 ./smokeping --master-url=http://smokeping/smokeping.cgi \
128 --cache-dir=/var/smokeping/ \
129 --shared-secret=/var/smokeping/secret.txt
130
131 The secret.txt file contains a single word, the secret of this slave.
132 It is NOT the same as the slavesecrets.conf file the master uses.
133
135 The master effectively has full access to slave hosts as the user
136 running the slave smokeping instance. The configuration is transferred
137 as Perl code that is evaluated on the slave. While this is done inside
138 a restricted "Safe" compartment, there are various ways that a
139 malicious master could embed arbitrary commands in the configuration
140 and get them to run when the slave probes its targets.
141
142 The strength of the shared secret is thus of paramount importance.
143 Brute forcing the secret would enable a man-in-the-middle to inject a
144 malicious new configuration and compromise the slave.
145
147 Copyright (c) 2007 by Tobias Oetiker, OETIKER+PARTNER AG. All right
148 reserved.
149
151 This program is free software; you can redistribute it and/or modify it
152 under the terms of the GNU General Public License as published by the
153 Free Software Foundation; either version 2 of the License, or (at your
154 option) any later version.
155
156 This program is distributed in the hope that it will be useful, but
157 WITHOUT ANY WARRANTY; without even the implied warranty of
158 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
159 General Public License for more details.
160
161 You should have received a copy of the GNU General Public License along
162 with this program; if not, write to the Free Software Foundation, Inc.,
163 675 Mass Ave, Cambridge, MA 02139, USA.
164
166 Tobias Oetiker <tobi@oetiker.ch>
167
168
169
1702.8.2 2023-07-22 SMOKEPING_MASTER_SLAVE(7)