Track1Agenda: exercises-smokeping-part1.txt

File exercises-smokeping-part1.txt, 8.0 KB (added by b.candler, 6 years ago)
Line 
1% Network Management & Monitoring
2% Smokeping - Part I
3
4Exercises
5---------
6
7In this exercise you will install Smokeping and get it to monitor various
8devices in the class netework.
9
10Since most of the tasks in this exercise require you to be "root", the
11first thing you should do is to connect to your PC and start a root shell.
12
13    $ sudo -s
14    #
15
16
171. Install Smokeping
18--------------------
19
20    # apt-get install smokeping
21
22Then point your web browser at
23
24    http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi
25
26(replace "pcN" with your own PC) to check that it is running.
27
28
292. Initial Configuration
30------------------------
31
32    # cd /etc/smokeping/config.d
33    # ls -l
34
35    -rwxr-xr-x 1 root root  578 2010-02-26 01:55 Alerts
36    -rwxr-xr-x 1 root root  237 2010-02-26 01:55 Database
37    -rwxr-xr-x 1 root root  413 2010-02-26 05:40 General
38    -rwxr-xr-x 1 root root  271 2010-02-26 01:55 pathnames
39    -rwxr-xr-x 1 root root  859 2010-02-26 01:55 Presentation
40    -rwxr-xr-x 1 root root  116 2010-02-26 01:55 Probes
41    -rwxr-xr-x 1 root root  155 2010-02-26 01:55 Slaves
42    -rwxr-xr-x 1 root root 8990 2010-02-26 06:30 Targets
43
44The files that you'll need to change, at a minimum, are:
45
46* Alerts
47* General
48* Probes
49* Targets
50
51Now open the General file (note the first capital letter)
52 
53    # editor General
54
55Change the following lines:
56
57~~~~
58owner    = NOC
59contact  = sysadm@localhost
60mailhost = localhost
61cgiurl   = http://localhost/cgi-bin/smokeping.cgi
62# specify this to get syslog logging
63syslogfacility = local5
64~~~~
65
66Save the file and exit. Now let's restart the Smokeping service to verify
67that no mistakes have been made before going any further:
68
69    # service smokeping stop
70    # service smokeping start
71
72A quicker way to do this is:
73
74    # service smokeping restart
75               
76We'll use this for the rest of the exercises, or we'll just use the "reload"
77directive as this is all you need for Smokeping to see configuration file
78changes.
79
80Now open the Alerts file (note the first capital letter)
81
82    # editor Alerts
83               
84Change the following lines:
85
86~~~~
87to = root@localhost
88from = smokeping-alert@localhost
89~~~~
90               
91Save the file and exit. Restart Smokeping:
92
93    # service smokeping reload
94
95
963. Configure monitoring of devices
97----------------------------------
98
99The majority of your time and work configuring Smokeping will be done in the
100file /etc/smokeping/config.d/Targets.
101       
102For this class please do the following:
103
104Use the default FPing probe to check:
105
106- some of the student PCs
107- classroom NOC
108- switches
109- routers
110
111You can use the classroom Network Diagram on the classroom wiki to figure out addresses
112for each item, etc.
113
114Create some hierarchy to the Smokeping menu for your checks. For example, the Targets
115file is already partially preconfigured. To start we are going to add some entries to
116this file. Start with:
117
118    # cd /etc/smokeping/config.d
119    # editor Targets
120
121You can take the section from `*** Targets ***` to the end of the LocalMachine and make it
122look something like this. Feel free to use your own "remark", "menu" text and titles. Note
123that we remove the commented lines `#parents = owner:/Test/James location:/`, and the "Alerts"
124line.
125
126NOTE: We strongly recommend that you COPY and PASTE text from these exercises directly in to the
127Targets file. Typing all this by hand will take too long.
128
129~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130*** Targets ***
131
132probe = FPing
133
134menu = Top
135title = Network Latency Grapher
136remark = Smokeping Latency Grapher for Network Monitoring \
137         and Management Workshop.
138
139+Local
140
141menu = Local Network Monitoring and Management
142title = Local Network
143
144++LocalMachine
145
146menu = Local Machine
147title = This host
148host = localhost
149~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
151Now, below the "localhost" we start with the configuration of items for our class.
152We can start simple and add just the first 4 PCs that are in Group 1 as well as an
153entry for our classroom NOC.
154
155~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156#
157# ********* Classroom Servers **********
158#
159
160+Servers
161
162menu = Servers
163title = Network Management Servers
164
165++noc
166
167menu = noc
168title = Workshop NOC
169host = noc.ws.nsrc.org
170
171#
172# ******** Student Machines (VMs) ***********
173#
174
175+PCs
176
177menu = Lab PCs
178title = Virtual PCs Network Management
179
180++pc1
181
182menu = pc1
183title = Virtual Machine 1
184host = pc1.ws.nsrc.org
185
186
187++pc2
188
189menu = pc2
190title = Virtual Machine 2
191host = pc2.ws.nsrc.org
192
193
194++pc3
195
196menu = pc3
197title = Virtual Machine 3
198host = pc3.ws.nsrc.org
199
200
201++pc4
202
203menu = pc4
204title = Virtual Machine 4
205host = pc4.ws.nsrc.org
206~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207
208
209OK. Let's see if we can get Smokeping to stop and start with the changes we have
210made, so far. Save and exit from the Targets file. Now try doing:
211
212    # service smokeping reload
213
214If you see error messages, then read them closely and try to correct the problem
215in the Targets file. In addition, Smokeping is now sending log message to the file
216/var/log/syslog. You can view what Smokeping is saying by typing:
217
218    # tail /var/log/syslog
219
220If you want to see all smokeping related messages in the file /var/log/syslog you
221can do this:
222
223    # grep smokeping /var/log/syslog
224
225If there are no errors you can view the results of your changes by going to:
226
227    http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi
228
229When you are ready you can edit the Targets file again and continue to add machines.
230At the bottom of the file you can add the next group of PCs:
231
232~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233++pc5
234
235menu = pc5
236title = Virtual Machine 5
237host = pc5.ws.nsrc.org
238
239
240++pc6
241
242menu = pc6
243title = Virtual Machine 6
244host = pc6.ws.nsrc.org
245
246
247++pc7
248
249menu = pc7
250title = Virtual Machine 7
251host = pc7.ws.nsrc.org
252
253
254++pc8
255
256menu = pc8
257title = Virtual Machine 8
258host = pc8.ws.nsrc.org
259~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260
261
262Add as many PCs as you want, then Save and exit from the Targets file and verify
263that the changes you have made are working:
264
265    # service smokeping reload
266
267You can continue to view the updated results of your changes on the Smokeping
268web page. It may take up to 5 minutes before graphs begin to appear.
269
270    http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi
271
272
273
2744. Configure monitoring of routers and switches
275-----------------------------------------------
276
277Once you have configured as many PCs as you want to configure, then it's time to
278add in some entries for the classroom routers and switch(es).
279
280    # cd /etc/smokeping/config.d                (just to be sure :-))
281    # editor Targets
282
283Go to the bottom of the file and add in some entries for routers and switches:
284
285
286~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287#
288# ********** Classroom Backbone Switch *********
289#
290
291+Switches
292
293menu = Switches
294title = Switches Network Management
295
296++sw
297
298menu = sw
299title = Backbone Switch
300host = sw.ws.nsrc.org
301
302#
303# ********** Virtual Routers: Cisco 7200 images *********
304#
305
306+Routers
307
308menu = Routers
309title = Virtual and Physical Routers Network Management
310
311++gw
312
313menu = rtr
314title = Gateway Router
315host = rtr.ws.nsrc.org
316
317++router1
318
319menu = router1
320title = Virtual Router 1
321host = rtr1.ws.nsrc.org
322
323++router2
324
325menu = router2
326title = Virtual Router 2
327host = rtr2.ws.nsrc.org
328
329++router3
330
331menu = router3
332title = Virtual Router 3
333host = rtr3.ws.nsrc.org
334~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335
336
337If you wish you can continue and add in entries for routers 4 to 6, or up to 9 if there are
338that many in your class. When you are ready Save and Exit from the Targets file and verify
339your work:
340
341    # service smokeping reload
342
343If you want you might consider adding the Wireless Access Point:
344
345    # editor Targets
346
347
348~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349#
350# Classrom Wireless Access Point
351#
352
353++ap1
354
355menu = ap1
356title = Wireless Access Point 1
357host = ap1.ws.nsrc.org
358~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359
360Save and Exit from the file and reload the Smokeping service:
361
362    # service smokeping reload
363
364