1 | Network Management & Monitoring |
---|
2 | Smokeping |
---|
3 | |
---|
4 | |
---|
5 | Exercises |
---|
6 | ---------- |
---|
7 | |
---|
8 | 0. Connect to your PC as the sysadm user and start a root shell |
---|
9 | |
---|
10 | |
---|
11 | $ sudo bash |
---|
12 | # |
---|
13 | |
---|
14 | |
---|
15 | 1. Install Smokeping |
---|
16 | -------------------- |
---|
17 | |
---|
18 | # apt-get install smokeping |
---|
19 | |
---|
20 | Then point your web browser at |
---|
21 | |
---|
22 | http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi |
---|
23 | |
---|
24 | to check that it is running. |
---|
25 | |
---|
26 | |
---|
27 | 2. Initial Configuration |
---|
28 | ------------------------ |
---|
29 | |
---|
30 | # cd /etc/smokeping/config.d |
---|
31 | # ls -l |
---|
32 | |
---|
33 | -rwxr-xr-x 1 root root 578 2010-02-26 01:55 Alerts |
---|
34 | -rwxr-xr-x 1 root root 237 2010-02-26 01:55 Database |
---|
35 | -rwxr-xr-x 1 root root 413 2010-02-26 05:40 General |
---|
36 | -rwxr-xr-x 1 root root 271 2010-02-26 01:55 pathnames |
---|
37 | -rwxr-xr-x 1 root root 859 2010-02-26 01:55 Presentation |
---|
38 | -rwxr-xr-x 1 root root 116 2010-02-26 01:55 Probes |
---|
39 | -rwxr-xr-x 1 root root 155 2010-02-26 01:55 Slaves |
---|
40 | -rwxr-xr-x 1 root root 8990 2010-02-26 06:30 Targets |
---|
41 | |
---|
42 | The files that you'll need to change, at a minimum, are: |
---|
43 | |
---|
44 | * Alerts |
---|
45 | * General |
---|
46 | * Probes |
---|
47 | * Targets |
---|
48 | |
---|
49 | Now open the General file (note the first capital letter) |
---|
50 | |
---|
51 | # editor General |
---|
52 | |
---|
53 | Change the following lines (don't leave them indented): |
---|
54 | |
---|
55 | owner = NOC |
---|
56 | contact = sysadmin@localhost |
---|
57 | cgiurl = http://localhost/cgi-bin/smokeping.cgi |
---|
58 | mailhost = localhost |
---|
59 | # specify this to get syslog logging |
---|
60 | syslogfacility = local5 |
---|
61 | |
---|
62 | Save the file and exit. Now let's restart the Smokeping service to verify |
---|
63 | that no mistakes have been made before going any further: |
---|
64 | |
---|
65 | # service smokeping stop |
---|
66 | # service smokeping start |
---|
67 | |
---|
68 | Warning! The "restart" option is not reliable. Use "stop" and "start" instead. |
---|
69 | |
---|
70 | |
---|
71 | 3. Configure monitoring of devices |
---|
72 | ---------------------------------- |
---|
73 | |
---|
74 | The majority of your time and work configuring Smokeping will be done in the |
---|
75 | file /etc/smokeping/config.d/Targets. |
---|
76 | |
---|
77 | For this class please do the following: |
---|
78 | |
---|
79 | Use the default FPing probe to check: |
---|
80 | |
---|
81 | - all the student NOC PCs |
---|
82 | - classroom NOC |
---|
83 | - switches |
---|
84 | - routers |
---|
85 | |
---|
86 | You can use the classroom Network Diagram on the classroom wiki to figure out addresses |
---|
87 | for each item, etc. |
---|
88 | |
---|
89 | Create some hierarchy to the Smokeping menu for your checks. For example, the Targets |
---|
90 | file is already partially preconfigured. To start we are going to add some entries to |
---|
91 | this file. Start with: |
---|
92 | |
---|
93 | # cd /etc/smokeping/config.d |
---|
94 | # editor Targets |
---|
95 | |
---|
96 | You can take the section from *** Targets *** to the end of the LocalMachine and make it |
---|
97 | look something like this. Feel free to use your own "remark", "menu" text and titles. |
---|
98 | |
---|
99 | The ">>>>>>>>" are not in the file, this indicates start of text, then "<<<<<<<<" is end |
---|
100 | of text: |
---|
101 | |
---|
102 | |
---|
103 | >>>>>>>> |
---|
104 | |
---|
105 | *** Targets *** |
---|
106 | |
---|
107 | probe = FPing |
---|
108 | |
---|
109 | ## You have to edit and uncomment all what you want below this. |
---|
110 | # Please, refer to smokeping_config man page for more info |
---|
111 | # The given adresses aren't real to avoid DoS. |
---|
112 | |
---|
113 | menu = Top |
---|
114 | title = Network Latency Grapher |
---|
115 | remark = Welcome to the SmokePing Latency Grapher for \ |
---|
116 | the GARNET-AfNOG-KNUST-NSRC Workshop |
---|
117 | |
---|
118 | +Local |
---|
119 | |
---|
120 | menu = Network Monitoring and Management |
---|
121 | title = NOC Server for Network Monitoring Class |
---|
122 | |
---|
123 | ++LocalMachine |
---|
124 | |
---|
125 | menu = localhost |
---|
126 | title = localhost |
---|
127 | host = localhost |
---|
128 | |
---|
129 | <<<<<<< |
---|
130 | |
---|
131 | |
---|
132 | Now, below the "localhost" we start with the configuration of items for our class. |
---|
133 | We can start simple and add just the first 4 PCs that are in Group 1 as well as an |
---|
134 | entry for our classroom NOC machine and our three Mac Mini server boxes. |
---|
135 | |
---|
136 | Warning! If you do not have properly functioning DNS resolution, then you will |
---|
137 | need to use the complete Fully Qualified Domain Name (FQDN) for each machine you are |
---|
138 | monitoring. Thus, instead of "host = pc1" you will need to specificy |
---|
139 | "host = pc1.ws.nsrc.org" |
---|
140 | |
---|
141 | |
---|
142 | >>>>>>>> |
---|
143 | |
---|
144 | # |
---|
145 | # ********* Classroom Servers ********** |
---|
146 | # |
---|
147 | |
---|
148 | +Servers |
---|
149 | |
---|
150 | menu = Servers |
---|
151 | title = Network Management Servers |
---|
152 | |
---|
153 | ++noc |
---|
154 | |
---|
155 | menu = noc |
---|
156 | title = Workshop NOC |
---|
157 | host = noc |
---|
158 | |
---|
159 | ++s1 |
---|
160 | |
---|
161 | menu = s1 |
---|
162 | title = s1 (Host MacMini for Student PCs) |
---|
163 | host = s1 |
---|
164 | |
---|
165 | ++s2 |
---|
166 | |
---|
167 | menu = s2 |
---|
168 | title = s2 (Host MacMini for Student PCs) |
---|
169 | host = s2 |
---|
170 | |
---|
171 | ++s3 |
---|
172 | |
---|
173 | menu = s3 |
---|
174 | title = s3 (Host MacMinit for Student PCs) |
---|
175 | host = s3 |
---|
176 | |
---|
177 | # |
---|
178 | # ******** Student Machines (VMs) *********** |
---|
179 | # |
---|
180 | |
---|
181 | +PCs |
---|
182 | |
---|
183 | menu = Lab PCs |
---|
184 | title = Virtual PCs Network Management |
---|
185 | |
---|
186 | ++pc1 |
---|
187 | |
---|
188 | menu = pc1 |
---|
189 | title = Virtual Machine 1 |
---|
190 | host = pc1 |
---|
191 | |
---|
192 | |
---|
193 | ++pc2 |
---|
194 | |
---|
195 | menu = pc2 |
---|
196 | title = Virtual Machine 2 |
---|
197 | host = pc2 |
---|
198 | |
---|
199 | |
---|
200 | ++pc3 |
---|
201 | |
---|
202 | menu = pc3 |
---|
203 | title = Virtual Machine 3 |
---|
204 | host = pc3 |
---|
205 | |
---|
206 | |
---|
207 | ++pc4 |
---|
208 | |
---|
209 | menu = pc4 |
---|
210 | title = Virtual Machine 4 |
---|
211 | host = pc4 |
---|
212 | |
---|
213 | <<<<<<<< |
---|
214 | |
---|
215 | |
---|
216 | OK. Let's see if we can get Smokeping to stop and start with the changes we have |
---|
217 | made, so far. Save and exit from the Targets file. Now try doing: |
---|
218 | |
---|
219 | # service smokeping stop |
---|
220 | # service smokeping start |
---|
221 | |
---|
222 | If you see error messages, then read them closely and try to correct the problem |
---|
223 | in the Targets file. In addition, Smokeping is now sending log message to the file |
---|
224 | /var/log/messages. You can view what Smokeping is saying by typing: |
---|
225 | |
---|
226 | # tail /var/log/messages |
---|
227 | |
---|
228 | If you want to see all smokeping related messages in the file /var/log/message you |
---|
229 | can do this: |
---|
230 | |
---|
231 | # grep smokeping /var/log/messages |
---|
232 | |
---|
233 | If there are no errors you can view the results of your changes by going to: |
---|
234 | |
---|
235 | http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi |
---|
236 | |
---|
237 | When you are read you can edit the Targets file again and continue to add machines. |
---|
238 | At the bottom of the file you can add the next group of PCs: |
---|
239 | |
---|
240 | |
---|
241 | >>>>>>>> |
---|
242 | |
---|
243 | ++pc5 |
---|
244 | |
---|
245 | menu = pc5 |
---|
246 | title = Virtual Machine 5 |
---|
247 | host = pc5 |
---|
248 | |
---|
249 | |
---|
250 | ++pc6 |
---|
251 | |
---|
252 | menu = pc6 |
---|
253 | title = Virtual Machine 6 |
---|
254 | host = pc6 |
---|
255 | |
---|
256 | |
---|
257 | ++pc7 |
---|
258 | |
---|
259 | menu = pc7 |
---|
260 | title = Virtual Machine 7 |
---|
261 | host = pc7 |
---|
262 | |
---|
263 | |
---|
264 | ++pc8 |
---|
265 | |
---|
266 | menu = pc8 |
---|
267 | title = Virtual Machine 8 |
---|
268 | host = pc8 |
---|
269 | |
---|
270 | <<<<<<<< |
---|
271 | |
---|
272 | |
---|
273 | Add as many PCs as you want, then Save and exit from the Targets file and verify |
---|
274 | that the changes you have made are working: |
---|
275 | |
---|
276 | # service smokeping stop |
---|
277 | # service smokeping start |
---|
278 | |
---|
279 | You can continue to view the updated results of your changes on the Smokeping |
---|
280 | web page. It may take up to 5 minutes before graphs beging to appear. |
---|
281 | |
---|
282 | http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi |
---|
283 | |
---|
284 | |
---|
285 | |
---|
286 | 4. Configure monitoring of routers and switches |
---|
287 | ----------------------------------------------- |
---|
288 | |
---|
289 | Once you have configured as many PCs as you want to configure, then it's time to |
---|
290 | add in some entries for the classroom routers and switch(es). |
---|
291 | |
---|
292 | # cd /etc/smokeping/config.d (just to be sure :-)) |
---|
293 | # editor Targets |
---|
294 | |
---|
295 | Go to the bottom of the file and add in some entries for routers and switches: |
---|
296 | |
---|
297 | |
---|
298 | >>>>>>>> |
---|
299 | |
---|
300 | # |
---|
301 | # ********** Classroom Backbone Switch ********* |
---|
302 | # |
---|
303 | |
---|
304 | +Switches |
---|
305 | |
---|
306 | menu = Switches |
---|
307 | title = Switches Network Management |
---|
308 | |
---|
309 | ++sw |
---|
310 | |
---|
311 | menu = sw |
---|
312 | title = Backbone Switch |
---|
313 | host = sw |
---|
314 | |
---|
315 | # |
---|
316 | # ********** Virtual Routers: Cisco 7200 images ********* |
---|
317 | # |
---|
318 | |
---|
319 | +Routers |
---|
320 | |
---|
321 | menu = Routers |
---|
322 | title = Virtual and Physical Routers Network Management |
---|
323 | |
---|
324 | ++gw |
---|
325 | |
---|
326 | menu = rtr |
---|
327 | title = Gateway Router |
---|
328 | host = rtr |
---|
329 | |
---|
330 | ++router1 |
---|
331 | |
---|
332 | menu = router1 |
---|
333 | title = Virtual Router 1 |
---|
334 | host = rtr1 |
---|
335 | |
---|
336 | ++router2 |
---|
337 | |
---|
338 | menu = router2 |
---|
339 | title = Virtual Router 2 |
---|
340 | host = rtr2 |
---|
341 | |
---|
342 | ++router3 |
---|
343 | |
---|
344 | menu = router3 |
---|
345 | title = Virtual Router 3 |
---|
346 | host = rtr3 |
---|
347 | |
---|
348 | <<<<<<<< |
---|
349 | |
---|
350 | |
---|
351 | If you wish you can continue and add in entries for routers 4 to 6, or to 9. |
---|
352 | When you are ready Save and Exit from the Targets file and verify your work: |
---|
353 | |
---|
354 | # service smokeping stop |
---|
355 | # service smokeping start |
---|
356 | |
---|
357 | If you want you might consider adding the Wireless Access Points: |
---|
358 | |
---|
359 | # editor Targets |
---|
360 | |
---|
361 | |
---|
362 | >>>>>>>> |
---|
363 | |
---|
364 | ++ap1 |
---|
365 | |
---|
366 | menu = ap1 |
---|
367 | title = Wireless Access Point 1 |
---|
368 | host = ap1 |
---|
369 | |
---|
370 | ++ap2 |
---|
371 | |
---|
372 | menu = ap2 |
---|
373 | title = Wireless Access Point 2 |
---|
374 | host = ap2 |
---|
375 | |
---|
376 | <<<<<<<< |
---|
377 | |
---|
378 | |
---|
379 | 5. Add new probes to Smokeping |
---|
380 | ------------------------------ |
---|
381 | |
---|
382 | The current entry in the Probes file is fine, but if you wish to use additional |
---|
383 | Smokeping checks you can add them in here and you can specify their default |
---|
384 | behavior. You can do this, as well, in the Targets file if you wish. |
---|
385 | |
---|
386 | To add a probe to check for HTTP latency as well as DNS lookup latency add the |
---|
387 | following to the end of the Probes file: |
---|
388 | |
---|
389 | # editor Probes |
---|
390 | |
---|
391 | |
---|
392 | >>>>>>>> |
---|
393 | |
---|
394 | + EchoPingHttp |
---|
395 | |
---|
396 | + DNS |
---|
397 | binary = /usr/bin/dig |
---|
398 | pings = 5 |
---|
399 | step = 180 |
---|
400 | lookup = www.nsrc.org |
---|
401 | |
---|
402 | <<<<<<<< |
---|
403 | |
---|
404 | |
---|
405 | The DNS probe will look up the IP address of www.nsrc.org using any other open |
---|
406 | DNS server you specify in the Targets file. You will see this a bit futher on. |
---|
407 | Now Save and exit from the file and verify that your changes are working: |
---|
408 | |
---|
409 | # service smokeping stop |
---|
410 | # service smokeping start |
---|
411 | |
---|
412 | |
---|
413 | 6. add HTTP latency checks for the classroom PCs |
---|
414 | ------------------------------------------------ |
---|
415 | |
---|
416 | Edit the Targets file again and go to the end of the file: |
---|
417 | |
---|
418 | # editor Targets |
---|
419 | |
---|
420 | At the end of the file add: |
---|
421 | |
---|
422 | |
---|
423 | >>>>>>>> |
---|
424 | |
---|
425 | # |
---|
426 | # Web server response |
---|
427 | # |
---|
428 | |
---|
429 | +HTTP |
---|
430 | |
---|
431 | menu = HTTP Response |
---|
432 | title = HTTP Response Student PCs |
---|
433 | |
---|
434 | ++pc1 |
---|
435 | |
---|
436 | menu = pc1 |
---|
437 | title = pc1 HTTP response time |
---|
438 | probe = EchoPingHttp |
---|
439 | host = pc1 |
---|
440 | |
---|
441 | ++pc2 |
---|
442 | |
---|
443 | menu = pc2 |
---|
444 | title = pc2 HTTP response time |
---|
445 | probe = EchoPingHttp |
---|
446 | host = pc2 |
---|
447 | |
---|
448 | ++pc3 |
---|
449 | |
---|
450 | menu = pc3 |
---|
451 | title = pc3 HTTP response time |
---|
452 | probe = EchoPingHttp |
---|
453 | host = pc3 |
---|
454 | |
---|
455 | ++pc4 |
---|
456 | |
---|
457 | menu = pc4 |
---|
458 | title = pc1 HTTP response time |
---|
459 | probe = EchoPingHttp |
---|
460 | host = pc4 |
---|
461 | |
---|
462 | <<<<<<<< |
---|
463 | |
---|
464 | |
---|
465 | You could actually just use the "probe = EchoPingHttp" statement once for pc1, |
---|
466 | and then this would be the default probe until another "probe = " statement is |
---|
467 | seen in the Targets file. |
---|
468 | |
---|
469 | You can add more PC entries if you wish, or you could consider checking the |
---|
470 | latency on remote machines - these are likely to be more interesting. Machines |
---|
471 | such as your own publicly accessible servers are a good choice, or, perhaps other |
---|
472 | web servers you use often (Google, Yahoo, Government pages, stores, etc.?). |
---|
473 | |
---|
474 | Once you are done, save and exit from the Targets file and verify your work: |
---|
475 | |
---|
476 | # service smokeping stop |
---|
477 | # service smokeping start |
---|
478 | |
---|
479 | |
---|
480 | 7. Add DNS latency checks |
---|
481 | ------------------------- |
---|
482 | |
---|
483 | At the end of the Targets file we are going to add some entries to verify the |
---|
484 | latency from our location to remote recursive DNS servers to look up an entry |
---|
485 | for nsrc.org. You would likely substitue an important address for your institution |
---|
486 | in the Probes file instead. In addition, you can change the address you are looking |
---|
487 | up inside the Targets file as well. For more information see: |
---|
488 | |
---|
489 | http://oss.oetiker.ch/smokeping/probe/DNS.en.html |
---|
490 | |
---|
491 | and |
---|
492 | |
---|
493 | http://oss.oetiker.ch/smokeping/probe/index.en.html |
---|
494 | |
---|
495 | Now edit the Targets file again. Be sure to go to the end of the file: |
---|
496 | |
---|
497 | # cd /etc/smokeping/config.d (just to be sure...) |
---|
498 | # editor Targets |
---|
499 | |
---|
500 | At the end of the file add: |
---|
501 | |
---|
502 | |
---|
503 | >>>>>>>> |
---|
504 | |
---|
505 | # |
---|
506 | # Sample DNS probe |
---|
507 | # |
---|
508 | |
---|
509 | +DNS |
---|
510 | |
---|
511 | probe = DNS |
---|
512 | menu = DNS Latency |
---|
513 | title = DNS Latency Probes |
---|
514 | |
---|
515 | ++LocalDNS1 |
---|
516 | menu = 10.10.0.250 |
---|
517 | title = DNS Delay for local DNS Server on noc.ws.nsrc.org |
---|
518 | host = noc.ws.nsrc.org |
---|
519 | |
---|
520 | ++GoogleA |
---|
521 | menu = 8.8.8.8 |
---|
522 | title = DNS Latency for google-public-dns-a.google.com |
---|
523 | host = google-public-dns-a.google.com |
---|
524 | |
---|
525 | ++GoogleB |
---|
526 | |
---|
527 | menu = 8.8.8.4 |
---|
528 | title = DNS Latency for google-public-dns-b.google.com |
---|
529 | host = google-public-dns-b.google.com |
---|
530 | |
---|
531 | ++OpenDNSA |
---|
532 | |
---|
533 | menu = 208.67.222.222 |
---|
534 | title = DNS Latency for resolver1.opendns.com |
---|
535 | host = resolver1.opendns.com |
---|
536 | |
---|
537 | ++OpenDNSB |
---|
538 | |
---|
539 | menu = 208.67.220.220 |
---|
540 | title = DNS Latency for resolver2.opendns.com |
---|
541 | host = resolver2.opendns.com |
---|
542 | |
---|
543 | <<<<<<<< |
---|
544 | |
---|
545 | |
---|
546 | Now save the Targets file and exit and verify your work: |
---|
547 | |
---|
548 | # service smokeping stop |
---|
549 | # service smokeping start |
---|
550 | |
---|
551 | Look at additional Smokeping probes and consider implementing some of |
---|
552 | them if they are useful to your ogranization: |
---|
553 | |
---|
554 | http://oss.oetiker.ch/smokeping/probe/index.en.html |
---|
555 | |
---|
556 | |
---|
557 | |
---|
558 | 8. MultiHost graphing |
---|
559 | --------------------- |
---|
560 | |
---|
561 | Once you have defined a group of hosts under a single probe type in your |
---|
562 | /etc/smokeping/config.d/Targets file, then you can create a single graph |
---|
563 | that will show you the results of all smokeping tests for all hosts that |
---|
564 | you define. This has the advantage of letting you quickly compare, for |
---|
565 | example, a group of hosts that you are monitoring with the FPing probe. |
---|
566 | |
---|
567 | The MultiHost graph function in Smokeping is extremely picky - pay close |
---|
568 | attention! |
---|
569 | |
---|
570 | To create a MultiHost graph first edit the file Targets: |
---|
571 | |
---|
572 | # editor Targets |
---|
573 | |
---|
574 | Find the end of your initial PC definitions. It should be just before you |
---|
575 | started to configure your routers and switches. That section starts with: |
---|
576 | |
---|
577 | |
---|
578 | >>>>>>>> |
---|
579 | |
---|
580 | # |
---|
581 | # ********** Classroom Backbone Switch ********* |
---|
582 | # |
---|
583 | |
---|
584 | <<<<<<<< |
---|
585 | |
---|
586 | |
---|
587 | So, just _before_ this we'll create two MultiHost entries. One will be for |
---|
588 | PCs number 1-12, or all the PCs in groups 1 to 3, and the other will be for |
---|
589 | PCs number 13-24, or all the PCs in groups 4 to 7. |
---|
590 | |
---|
591 | Warning! If you have not already configured PCs 1 to 24, then do not configure |
---|
592 | any entries with PCs that are not yet defined. |
---|
593 | |
---|
594 | Now add the two MultiHost entries. They look like this: |
---|
595 | |
---|
596 | |
---|
597 | >>>>>>>> |
---|
598 | |
---|
599 | ++MultihostHTTPGroups1-3 |
---|
600 | |
---|
601 | menu = MultihostHTTPGroups1-3 |
---|
602 | title = Combined HTTP Results |
---|
603 | host = /HTTP/pc1 /HTTP/pc2 /HTTP/pc3 /HTTP/pc4 /HTTP/pc5 /HTTP/pc6 \ |
---|
604 | /HTTP/pc7 /HTTP/pc8 /HTTP/pc9 /HTTP/pc10 /HTTP/pc11 /HTTP/pc12 |
---|
605 | |
---|
606 | ++MultihostHTTPGroups4-6 |
---|
607 | |
---|
608 | menu = MultihostHTTPGroups4-6 |
---|
609 | title = Combined HTTP Results |
---|
610 | host = /HTTP/pc13 /HTTP/pc14 /HTTP/pc15 /HTTP/pc16 /HTTP/pc17 /HTTP/pc18 \ |
---|
611 | /HTTP/pc19 /HTTP/pc20 /HTTP/pc21 /HTTP/pc22 /HTTP/pc23 /HTTP/pc24 |
---|
612 | |
---|
613 | <<<<<<<< |
---|
614 | |
---|
615 | |
---|
616 | Save and exit from the Targets file. Now attempt to restart Smokeping: |
---|
617 | |
---|
618 | # service smokeping stop |
---|
619 | # service smokeping start |
---|
620 | |
---|
621 | If this fails you almost certainly have an error in the entries. If you cannot figure out what the error |
---|
622 | is (remember to try "tail /var/log/messages" first!) ask your instructor for some help. |
---|
623 | |
---|
624 | If things work and you want to add a MultiHost entry for your DNS servers, then edit the file Targets, |
---|
625 | but go to the very end of the file and add: |
---|
626 | |
---|
627 | |
---|
628 | >>>>>>>> |
---|
629 | |
---|
630 | # |
---|
631 | # Multihost Graph of all DNS latency checks |
---|
632 | # |
---|
633 | |
---|
634 | ++MultiHostDNS |
---|
635 | |
---|
636 | menu = MultiHost DNS |
---|
637 | title = Consolidated DNS Responses |
---|
638 | host = /DNS/LocalDNS1 /DNS/GoogleA /DNS/GoogleB /DNS/OpenDNSA /DNS/OpenDNSB \ |
---|
639 | /DNS/DNSAdvantageA /DNS/DNSAdvantageB |
---|
640 | <<<<<<<< |
---|
641 | |
---|
642 | And, as always, save and exit from the file Targets and test your new configuration. |
---|
643 | |
---|
644 | |
---|
645 | 9. Send Smokeping alerts |
---|
646 | ------------------------ |
---|
647 | |
---|
648 | If you wish to receive an email when an alert condition is met on one of the |
---|
649 | Smokeping checks first do this: |
---|
650 | |
---|
651 | # cd /etc/smokeping/config.d |
---|
652 | # editor Alerts |
---|
653 | |
---|
654 | Update the top of the file where it says: |
---|
655 | |
---|
656 | *** Alerts *** |
---|
657 | to = alertee@address.somewhere |
---|
658 | from = smokealert@company.xy |
---|
659 | |
---|
660 | to include a proper "to" and "from" field for your server. Something like: |
---|
661 | |
---|
662 | *** Alerts *** |
---|
663 | to = sysadm@localhost |
---|
664 | from = smokeping-alert@localhost |
---|
665 | |
---|
666 | Now you must update your device entries to include a line that reads: |
---|
667 | |
---|
668 | alerts = alertName1, alertName2, etc, etc... |
---|
669 | |
---|
670 | For instance, the alerts named, "startloss", "bigloss", and "rttdetect" have already been |
---|
671 | defined in the file Alerts: |
---|
672 | |
---|
673 | To read about Smokeping alerts and what they are detecting, how to create your own, etc. see: |
---|
674 | |
---|
675 | http://oss.oetiker.ch/smokeping/doc/smokeping_config.en.html |
---|
676 | |
---|
677 | and at the bottom of the page is a section titled, "*** Alerts ***" |
---|
678 | |
---|
679 | To place some alert detection on some of your hosts open the file Targets: |
---|
680 | |
---|
681 | # editor Targets |
---|
682 | |
---|
683 | and go near the start of the file where we defined our PCs. Just under the "host =" line add |
---|
684 | another line that looks like this: |
---|
685 | |
---|
686 | alerts = startloss,bigloss,rttdetect |
---|
687 | |
---|
688 | So, for example, the pc1 entry would not look like this: |
---|
689 | |
---|
690 | >>>>>>>> |
---|
691 | |
---|
692 | ++pc1 |
---|
693 | |
---|
694 | menu = pc1 |
---|
695 | title = Virtual Machine 1 |
---|
696 | host = pc1 |
---|
697 | alerts = startloss,bigloss,rttdetect |
---|
698 | |
---|
699 | <<<<<<<< |
---|
700 | |
---|
701 | If you want to add an alerts option to other hosts go ahead. Once you are done save and |
---|
702 | exit from the Targets file and then verify that your configuration works: |
---|
703 | |
---|
704 | # service smokeping stop |
---|
705 | # service smokeping start |
---|
706 | |
---|
707 | If any of the hosts that have the "alerts = " option set meet the conditions to set off the |
---|
708 | alert, then an email will arrive to the sysadm user's mailbox on the Smokeping server |
---|
709 | machine (localhost). It's not likely that an alert will be set off for most machines. To |
---|
710 | check you can read the email for the sysadm user by using an email client like "mutt" - |
---|
711 | |
---|
712 | # apt-get install mutt |
---|
713 | # mutt |
---|
714 | |
---|
715 | Say yes to mailbox creation when prompted, then see if you have email from the |
---|
716 | smokeping-alerts@localhost user. |
---|
717 | |
---|
718 | |
---|
719 | 10. Slave instances - Informational Only |
---|
720 | ---------------------------------------- |
---|
721 | |
---|
722 | This is a description only for informational purposes in case you wish |
---|
723 | to attempt this type of configuration once the workshop is over. |
---|
724 | |
---|
725 | The idea behind this is that you can run multiple smokeping instances |
---|
726 | at multiple locations that are monitoring the same hosts and/or services |
---|
727 | as your master instance. The slaves will send their results to the |
---|
728 | master server and you will see these results side-by-side with your |
---|
729 | local results. This allows you to view how users outside your network |
---|
730 | see your services and hosts. |
---|
731 | |
---|
732 | This can be a powerful tool for resolving service and host issues that |
---|
733 | may be difficult to troubleshoot if you only have local data. |
---|
734 | |
---|
735 | Graphically this looks this: |
---|
736 | |
---|
737 | [slave 1] [slave 2] [slave 3] |
---|
738 | | | | |
---|
739 | +-------+ | +--------+ |
---|
740 | | | | |
---|
741 | v v v |
---|
742 | +---------------+ |
---|
743 | | master | |
---|
744 | +---------------+ |
---|
745 | |
---|
746 | You can see example of this data here: |
---|
747 | |
---|
748 | http://oss.oetiker.ch/smokeping-demo/ |
---|
749 | |
---|
750 | Look at the various graph groups and notice that many of the graphs |
---|
751 | have multiple lines with the color code chart listing items such as |
---|
752 | "median RTT from mipsrv01" - These are not MultiHost graphs, but rather |
---|
753 | graphs with data from external smokeping servers. |
---|
754 | |
---|
755 | To configure a smokeping master/slave server you can see the documentation |
---|
756 | here: |
---|
757 | |
---|
758 | http://oss.oetiker.ch/smokeping/doc/smokeping_master_slave.en.html |
---|
759 | |
---|
760 | In addition, a sample set of steps for configuring this is available in |
---|
761 | the file sample-smokeping-master-slave.txt which should be lisetd as an |
---|
762 | additional reference at the bottom of the Agenda page on your classroom wiki. |
---|
763 | |
---|