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