Track1Agenda: exercises_smokeping_wireless.md.html

File exercises_smokeping_wireless.md.html, 12.8 KB (added by jon, 6 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5  <meta http-equiv="Content-Style-Type" content="text/css" />
6  <meta name="generator" content="pandoc" />
7  <title></title>
8  <style type="text/css">code{white-space: pre;}</style>
9  <link href="data:text/css;charset=utf-8,%0A%0A%0A%0Adiv%23header%2C%20header%0A%7B%0A%0Aborder%2Dbottom%3A%201px%20solid%20%23aaa%3B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0A%2Etitle%20%0A%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%2Eauthor%2C%20%2Edate%20%0A%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%0Adiv%23TOC%2C%20nav%23TOC%0A%7B%0A%0Aborder%2Dbottom%3A%201px%20solid%20%23aaa%3B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0A%40media%20print%0A%7B%0Adiv%23TOC%2C%20nav%23TOC%0A%7B%0A%0Adisplay%3A%20none%3B%0A%7D%0A%7D%0A%0Ah1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%0A%7B%0Afont%2Dfamily%3A%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20%22Liberation%20Sans%22%2C%20Calibri%2C%20Arial%2C%20sans%2Dserif%3B%20%0A%0Apage%2Dbreak%2Dafter%3A%20avoid%3B%20%0A%7D%0A%0Adiv%20div%2C%20section%20section%20%0A%7B%0Amargin%2Dleft%3A%202em%3B%20%0A%7D%0Ap%20%7B%7D%0Ablockquote%0A%7B%20font%2Dstyle%3A%20italic%3B%0A%7D%0Ali%20%0A%7B%0A%7D%0Ali%20%3E%20p%20%0A%7B%0Amargin%2Dtop%3A%201em%3B%20%0A%7D%0Aul%20%0A%7B%0A%7D%0Aul%20li%20%0A%7B%0A%7D%0Aol%20%0A%7B%0A%7D%0Aol%20li%20%0A%7B%0A%7D%0Ahr%20%7B%7D%0A%0Asub%20%0A%7B%0A%7D%0Asup%20%0A%7B%0A%7D%0Aem%20%0A%7B%0A%7D%0Aem%20%3E%20em%20%0A%7B%0Afont%2Dstyle%3A%20normal%3B%0A%7D%0Astrong%20%0A%7B%0A%7D%0A%0Aa%20%0A%7B%0A%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0A%40media%20screen%0A%7B%0Aa%3Ahover%0A%7B%0A%0Atext%2Ddecoration%3A%20underline%3B%0A%7D%0A%7D%0A%40media%20print%0A%7B%0Aa%20%7B%0A%0Acolor%3A%20black%3B%0Abackground%3A%20transparent%3B%0A%7D%0Aa%5Bhref%5E%3D%22http%3A%2F%2F%22%5D%3Aafter%2C%20a%5Bhref%5E%3D%22https%3A%2F%2F%22%5D%3Aafter%0A%7B%0A%0Acontent%3A%20%22%20%28%22%20attr%28href%29%20%22%29%20%22%3B%0Afont%2Dsize%3A%2090%25%3B%0A%7D%0A%7D%0A%0Aimg%0A%7B%0A%0Avertical%2Dalign%3A%20middle%3B%0A%7D%0Adiv%2Efigure%20%0A%7B%0A%0Amargin%2Dleft%3A%20auto%3B%0Amargin%2Dright%3A%20auto%3B%0Atext%2Dalign%3A%20center%3B%0Afont%2Dstyle%3A%20italic%3B%0A%7D%0Ap%2Ecaption%20%0A%7B%0A%0A%7D%0A%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23fdf7ee%3B%0A%0A%0A%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0Awhite%2Dspace%3A%20%2Dmoz%2Dpre%2Dwrap%20%21important%3B%20%0Awhite%2Dspace%3A%20%2Dpre%2Dwrap%3B%20%0Awhite%2Dspace%3A%20%2Do%2Dpre%2Dwrap%3B%20%0Aword%2Dwrap%3A%20break%2Dword%3B%20%0A%0A%7D%0Apre%20%0A%7B%0A%0Apadding%3A%200%2E5em%3B%20%0Aborder%2Dradius%3A%205px%3B%20%0A%0Aborder%3A%201px%20solid%20%23aaa%3B%0A%0Amargin%2Dleft%3A%200%2E5em%3B%0Amargin%2Dright%3A%200%2E5em%3B%0A%7D%0A%40media%20screen%0A%7B%0Apre%0A%7B%0A%0Awhite%2Dspace%3A%20pre%3B%0Aoverflow%3A%20auto%3B%0A%0Aborder%3A%201px%20dotted%20%23777%3B%0A%7D%0A%7D%0Acode%20%0A%7B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%0A%7B%0A%0Apadding%2Dleft%3A%202px%3B%0Apadding%2Dright%3A%202px%3B%0A%7D%0Ali%20%3E%20p%20code%20%0A%7B%0A%0Apadding%3A%202px%3B%0A%7D%0A%0Aspan%2Emath%20%0A%7B%0A%0A%7D%0Adiv%2Emath%20%0A%7B%0A%7D%0Aspan%2ELaTeX%20%0A%7B%0A%7D%20eq%20%0A%7B%0A%7D%20%0A%0Atable%0A%7B%0Aborder%2Dcollapse%3A%20collapse%3B%0Aborder%2Dspacing%3A%200%3B%20%0Aborder%2Dbottom%3A%202pt%20solid%20%23000%3B%0Aborder%2Dtop%3A%202pt%20solid%20%23000%3B%20%0A%0Amargin%2Dleft%3A%20auto%3B%0Amargin%2Dright%3A%20auto%3B%0A%7D%0Athead%20%0A%7B%0Aborder%2Dbottom%3A%201pt%20solid%20%23000%3B%0Abackground%2Dcolor%3A%20%23eee%3B%20%0A%7D%0Atr%2Eheader%20%0A%7B%0A%7D%20tbody%20%0A%7B%0A%7D%0A%0Atr%20%7B%0A%7D%0Atr%2Eodd%3Ahover%2C%20tr%2Eeven%3Ahover%20%0A%7B%0Abackground%2Dcolor%3A%20%23eee%3B%0A%7D%0A%0Atr%2Eodd%20%7B%7D%0Atr%2Eeven%20%7B%7D%0Atd%2C%20th%20%0A%7B%20vertical%2Dalign%3A%20top%3B%20%0Avertical%2Dalign%3A%20baseline%3B%20%0Apadding%2Dleft%3A%200%2E5em%3B%0Apadding%2Dright%3A%200%2E5em%3B%0Apadding%2Dtop%3A%200%2E2em%3B%0Apadding%2Dbottom%3A%200%2E2em%3B%0A%7D%0A%0A%0Ath%20%0A%7B%0Afont%2Dweight%3A%20bold%3B%20%7D%0Atfoot%20%0A%7B%0A%7D%0Acaption%20%0A%7B%0Acaption%2Dside%3A%20top%3B%0Aborder%3A%20none%3B%0Afont%2Dsize%3A%200%2E9em%3B%0Afont%2Dstyle%3A%20italic%3B%0Atext%2Dalign%3A%20center%3B%0Amargin%2Dbottom%3A%200%2E3em%3B%20%0Apadding%2Dbottom%3A%200%2E2em%3B%0A%7D%0A%0Adl%20%0A%7B%0Aborder%2Dtop%3A%202pt%20solid%20black%3B%0Apadding%2Dtop%3A%200%2E5em%3B%0Aborder%2Dbottom%3A%202pt%20solid%20black%3B%0A%7D%0Adt%20%0A%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Add%2Bdt%20%0A%7B%0Aborder%2Dtop%3A%201pt%20solid%20black%3B%0Apadding%2Dtop%3A%200%2E5em%3B%0A%7D%0Add%20%0A%7B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0Add%2Bdd%20%0A%7B%0Aborder%2Dtop%3A%201px%20solid%20black%3B%20%0A%7D%0A%0Aa%2Efootnote%2C%20a%2EfootnoteRef%20%7B%20%0Afont%2Dsize%3A%20small%3B%20vertical%2Dalign%3A%20text%2Dtop%3B%0A%7D%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%0A%7B%0A%7D%0A%40media%20print%0A%7B%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%0A%7B%0A%0Adisplay%3A%20none%3B%0A%7D%0A%7D%0Adiv%2Efootnotes%20%0A%7B%0A%7D%0Adiv%2Efootnotes%20li%5Bid%5E%3D%22fn%22%5D%20%0A%7B%0A%7D%0A%0A%40media%20print%0A%7B%0A%2Enoprint%0A%7B%0Adisplay%3Anone%3B%0A%7D%0A%7D%0A" rel="stylesheet" type="text/css" />
10</head>
11<body>
12<div id="TOC">
13<ul>
14<li><a href="#network-management-monitoring---smokeping---part-i"><span class="toc-section-number">1</span> Network Management &amp; Monitoring - Smokeping - Part I</a><ul>
15<li><a href="#exercises"><span class="toc-section-number">1.1</span> Exercises</a></li>
16<li><a href="#install-smokeping"><span class="toc-section-number">1.2</span> 1. Install Smokeping</a></li>
17<li><a href="#initial-configuration"><span class="toc-section-number">1.3</span> 2. Initial Configuration</a></li>
18<li><a href="#configure-monitoring-of-devices"><span class="toc-section-number">1.4</span> 3. Configure monitoring of devices</a></li>
19</ul></li>
20<li><a href="#section"><span class="toc-section-number">2</span> </a></li>
21<li><a href="#classrom-wireless-access-point"><span class="toc-section-number">3</span> Classrom Wireless Access Point</a></li>
22<li><a href="#section-1"><span class="toc-section-number">4</span> </a></li>
23</ul>
24</div>
25<h1 id="network-management-monitoring---smokeping---part-i"><span class="header-section-number">1</span> Network Management &amp; Monitoring - Smokeping - Part I</h1>
26<h2 id="exercises"><span class="header-section-number">1.1</span> Exercises</h2>
27<p>In this exercise you will install Smokeping and get it to monitor various devices in the class network.</p>
28<p>Since most of the tasks in this exercise require you to be &quot;root&quot;, the first thing you should do is to connect to your PC and start a root shell.</p>
29<pre><code>$ sudo -s
30#</code></pre>
31<h2 id="install-smokeping"><span class="header-section-number">1.2</span> 1. Install Smokeping</h2>
32<pre><code># apt-get install smokeping</code></pre>
33<p>For Ubuntu 14.04: you need to install a symlink to the apache2 config</p>
34<pre><code># ln -s /etc/smokeping/apache2.conf /etc/apache2/conf-available/smokeping.conf
35# a2enconf smokeping</code></pre>
36<p>Also, the CGI module needs to be enabled in Apache:</p>
37<pre><code># a2enmod cgi</code></pre>
38<p>Finally, reload the Apache configuration:</p>
39<pre><code># service apache2 reload</code></pre>
40<p>Then point your web browser at</p>
41<pre><code>http://pcN.ws.nsrc.org/smokeping/smokeping.cgi</code></pre>
42<p>(replace &quot;pcN&quot; with your own PC) to check that it is running.</p>
43<h2 id="initial-configuration"><span class="header-section-number">1.3</span> 2. Initial Configuration</h2>
44<pre><code># cd /etc/smokeping/config.d
45# ls -l
46
47-rwxr-xr-x 1 root root  578 2010-02-26 01:55 Alerts
48-rwxr-xr-x 1 root root  237 2010-02-26 01:55 Database
49-rwxr-xr-x 1 root root  413 2010-02-26 05:40 General
50-rwxr-xr-x 1 root root  271 2010-02-26 01:55 pathnames
51-rwxr-xr-x 1 root root  859 2010-02-26 01:55 Presentation
52-rwxr-xr-x 1 root root  116 2010-02-26 01:55 Probes
53-rwxr-xr-x 1 root root  155 2010-02-26 01:55 Slaves
54-rwxr-xr-x 1 root root 8990 2010-02-26 06:30 Targets</code></pre>
55<p>The files that you'll need to change, at a minimum, are:</p>
56<ul>
57<li>Alerts</li>
58<li>General</li>
59<li>Probes</li>
60<li>Targets</li>
61</ul>
62<p>Now open the General file (note the first capital letter)</p>
63<pre><code># editor General</code></pre>
64<p>Change the following lines:</p>
65<pre><code>owner    = NOC
66contact  = sysadm@localhost
67mailhost = localhost
68cgiurl   = http://localhost/smokeping/smokeping.cgi
69# specify this to get syslog logging
70syslogfacility = local5</code></pre>
71<p>Save the file and exit. Now let's restart the Smokeping service to verify that no mistakes have been made before going any further:</p>
72<pre><code># service smokeping stop
73# service smokeping start</code></pre>
74<p>A quicker way to do this is:</p>
75<pre><code># service smokeping restart</code></pre>
76<p>We'll use this for the rest of the exercises, or we'll just use the &quot;reload&quot; directive as this is all you need for Smokeping to see configuration file changes.</p>
77<p>Now open the Alerts file (note the first capital letter)</p>
78<pre><code># editor Alerts</code></pre>
79<p>Change the following lines:</p>
80<pre><code>to = root@localhost
81from = smokeping-alert@localhost</code></pre>
82<p>Save the file and exit. Restart Smokeping:</p>
83<pre><code># service smokeping reload</code></pre>
84<h2 id="configure-monitoring-of-devices"><span class="header-section-number">1.4</span> 3. Configure monitoring of devices</h2>
85<p>The majority of your time and work configuring Smokeping will be done in the file /etc/smokeping/config.d/Targets.</p>
86<p>For this class please do the following:</p>
87<p>Use the default FPing probe to check:</p>
88<ul>
89<li>your wireless link</li>
90<li>classroom NOC (noc.ws.nsrc.org)</li>
91<li>classroom Wi-Fi (ap1.ws.nsrc.org)</li>
92</ul>
93<p>Create some hierarchy to the Smokeping menu for your checks. For example, the Targets file is already partially preconfigured. To start we are going to add some entries to this file. Start with:</p>
94<pre><code># cd /etc/smokeping/config.d
95# editor Targets</code></pre>
96<p>You can take the section from <code>*** Targets ***</code> to the end of the LocalMachine and make it look something like this. Feel free to use your own &quot;remark&quot;, &quot;menu&quot; text and titles. Note that we remove the commented lines <code>#parents = owner:/Test/James location:/</code>, and the &quot;Alerts&quot; line.</p>
97<p>NOTE: We strongly recommend that you COPY and PASTE text from these exercises directly in to the Targets file. Typing all this by hand will take too long.</p>
98<pre><code>*** Targets ***
99
100probe = FPing
101
102menu = Top
103title = Network Latency Grapher
104remark = Smokeping Latency Grapher for Network Monitoring \
105         and Management Workshop.
106
107+Local
108
109menu = Local Network Monitoring and Management
110title = Local Network
111
112++LocalMachine
113
114menu = Local Machine
115title = This host
116host = localhost</code></pre>
117<p>Now, below the &quot;localhost&quot; we start with the configuration of items for our class. We can start simple and add just the first 4 PCs that are in Group 1 as well as an entry for our classroom NOC.</p>
118<pre><code>#
119# ********* Classroom Servers **********
120#
121
122+Servers
123
124menu = Servers
125title = Network Management Servers
126
127++noc
128
129menu = noc
130title = Workshop NOC
131host = noc.ws.nsrc.org
132
133#
134# ******** Wireless Radios ***********
135#
136
137+Radios
138
139menu = Wireless Radios
140title = Wireless Linking Equipment
141
142++rtr1
143
144menu = rtr1
145title = Radio 1
146host = 10.10.0.xx
147
148
149++rtr2
150
151menu = rtr2
152title = Radio 2
153host = 10.10.0.xx
154
155
156++ap1
157
158menu = ap1
159title = WiFi ap1
160host = 10.10.0.xx
161</code></pre>
162<p>OK. Let's see if we can get Smokeping to stop and start with the changes we have made, so far. Save and exit from the Targets file. Now try doing:</p>
163<pre><code># service smokeping reload</code></pre>
164<p>If you see error messages, then read them closely and try to correct the problem in the Targets file. In addition, Smokeping is now sending log message to the file /var/log/syslog. You can view what Smokeping is saying by typing:</p>
165<pre><code># tail /var/log/syslog</code></pre>
166<p>If you want to see all smokeping related messages in the file /var/log/syslog you can do this:</p>
167<pre><code># grep smokeping /var/log/syslog</code></pre>
168<p>If there are no errors you can view the results of your changes by going to:</p>
169<pre><code>http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi</code></pre>
170<h1 id="section"><span class="header-section-number">2</span> </h1>
171<h1 id="classrom-wireless-access-point"><span class="header-section-number">3</span> Classrom Wireless Access Point</h1>
172<h1 id="section-1"><span class="header-section-number">4</span> </h1>
173<p>++ap1</p>
174<p>menu = ap1 title = Wireless Access Point 1 host = ap1.ws.nsrc.org ```</p>
175<p>Save and Exit from the file and reload the Smokeping service:</p>
176<pre><code># service smokeping reload</code></pre>
177</body>
178</html>