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