Agenda: exercises-smokeping-part1.htm

File exercises-smokeping-part1.htm, 9.9 KB (added by admin, 5 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  <meta name="author" content="Smokeping - Part I" />
8  <title>Network Management &amp; Monitoring</title>
9  <style type="text/css">code{white-space: pre;}</style>
10  <link rel="stylesheet" href="http://noc.ws.nsrc.org/configs/css/style.css" type="text/css" />
11</head>
12<body>
13<div id="header">
14<h1 class="title">Network Management &amp; Monitoring</h1>
15<h2 class="author">Smokeping - Part I</h2>
16</div>
17<div id="TOC">
18<ul>
19<li><a href="#exercises"><span class="toc-section-number">0.1</span> Exercises</a></li>
20<li><a href="#install-smokeping"><span class="toc-section-number">0.2</span> 1. Install Smokeping</a></li>
21<li><a href="#initial-configuration"><span class="toc-section-number">0.3</span> 2. Initial Configuration</a></li>
22<li><a href="#configure-monitoring-of-devices"><span class="toc-section-number">0.4</span> 3. Configure monitoring of devices</a></li>
23<li><a href="#configure-monitoring-of-routers-and-switches"><span class="toc-section-number">0.5</span> 4. Configure monitoring of routers and switches</a></li>
24</ul>
25</div>
26<h2 id="exercises"><a href="#exercises"><span class="header-section-number">0.1</span> Exercises</a></h2>
27<p>In this exercise you will install Smokeping and get it to monitor various devices in the class netework.</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"><a href="#install-smokeping"><span class="header-section-number">0.2</span> 1. Install Smokeping</a></h2>
32<pre><code># apt-get install smokeping</code></pre>
33<p>Then point your web browser at</p>
34<pre><code>http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi</code></pre>
35<p>(replace &quot;pcN&quot; with your own PC) to check that it is running.</p>
36<h2 id="initial-configuration"><a href="#initial-configuration"><span class="header-section-number">0.3</span> 2. Initial Configuration</a></h2>
37<pre><code># cd /etc/smokeping/config.d
38# ls -l
39
40-rwxr-xr-x 1 root root  578 2010-02-26 01:55 Alerts
41-rwxr-xr-x 1 root root  237 2010-02-26 01:55 Database
42-rwxr-xr-x 1 root root  413 2010-02-26 05:40 General
43-rwxr-xr-x 1 root root  271 2010-02-26 01:55 pathnames
44-rwxr-xr-x 1 root root  859 2010-02-26 01:55 Presentation
45-rwxr-xr-x 1 root root  116 2010-02-26 01:55 Probes
46-rwxr-xr-x 1 root root  155 2010-02-26 01:55 Slaves
47-rwxr-xr-x 1 root root 8990 2010-02-26 06:30 Targets</code></pre>
48<p>The files that you'll need to change, at a minimum, are:</p>
49<ul>
50<li>Alerts</li>
51<li>General</li>
52<li>Probes</li>
53<li>Targets</li>
54</ul>
55<p>Now open the General file (note the first capital letter)</p>
56<pre><code># editor General</code></pre>
57<p>Change the following lines:</p>
58<pre><code>owner    = NOC
59contact  = sysadm@localhost
60mailhost = localhost
61cgiurl   = http://localhost/cgi-bin/smokeping.cgi
62# specify this to get syslog logging
63syslogfacility = local5</code></pre>
64<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>
65<pre><code># service smokeping stop
66# service smokeping start</code></pre>
67<p>A quicker way to do this is:</p>
68<pre><code># service smokeping restart
69    </code></pre>
70<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>
71<p>Now open the Alerts file (note the first capital letter)</p>
72<pre><code># editor Alerts
73    </code></pre>
74<p>Change the following lines:</p>
75<pre><code>to = root@localhost
76from = smokeping-alert@localhost</code></pre>
77<p>Save the file and exit. Restart Smokeping:</p>
78<pre><code># service smokeping reload</code></pre>
79<h2 id="configure-monitoring-of-devices"><a href="#configure-monitoring-of-devices"><span class="header-section-number">0.4</span> 3. Configure monitoring of devices</a></h2>
80<p>The majority of your time and work configuring Smokeping will be done in the file /etc/smokeping/config.d/Targets.</p>
81<p>For this class please do the following:</p>
82<p>Use the default FPing probe to check:</p>
83<ul>
84<li>some of the student PCs</li>
85<li>classroom NOC</li>
86<li>switches</li>
87<li>routers</li>
88</ul>
89<p>You can use the classroom Network Diagram on the classroom wiki to figure out addresses for each item, etc.</p>
90<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>
91<pre><code># cd /etc/smokeping/config.d
92# editor Targets</code></pre>
93<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>
94<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>
95<pre><code>*** Targets ***
96
97probe = FPing
98
99menu = Top
100title = Network Latency Grapher
101remark = Smokeping Latency Grapher for Network Monitoring \
102         and Management Workshop.
103
104+Local
105
106menu = Local Network Monitoring and Management
107title = Local Network
108
109++LocalMachine
110
111menu = Local Machine
112title = This host
113host = localhost</code></pre>
114<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>
115<pre><code>#
116# ********* Classroom Servers **********
117#
118
119+Servers
120
121menu = Servers
122title = Network Management Servers
123
124++noc
125
126menu = noc
127title = Workshop NOC
128host = noc.ws.nsrc.org
129
130#
131# ******** Student Machines (VMs) ***********
132#
133
134+PCs
135
136menu = Lab PCs
137title = Virtual PCs Network Management
138
139++pc1
140
141menu = pc1
142title = Virtual Machine 1
143host = pc1.ws.nsrc.org
144
145
146++pc2
147
148menu = pc2
149title = Virtual Machine 2
150host = pc2.ws.nsrc.org
151
152
153++pc3
154
155menu = pc3
156title = Virtual Machine 3
157host = pc3.ws.nsrc.org
158
159
160++pc4
161
162menu = pc4
163title = Virtual Machine 4
164host = pc4.ws.nsrc.org</code></pre>
165<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>
166<pre><code># service smokeping reload</code></pre>
167<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>
168<pre><code># tail /var/log/syslog</code></pre>
169<p>If you want to see all smokeping related messages in the file /var/log/syslog you can do this:</p>
170<pre><code># grep smokeping /var/log/syslog</code></pre>
171<p>If there are no errors you can view the results of your changes by going to:</p>
172<pre><code>http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi</code></pre>
173<p>When you are ready you can edit the Targets file again and continue to add machines. At the bottom of the file you can add the next group of PCs:</p>
174<pre><code>++pc5
175
176menu = pc5
177title = Virtual Machine 5
178host = pc5.ws.nsrc.org
179
180
181++pc6
182
183menu = pc6
184title = Virtual Machine 6
185host = pc6.ws.nsrc.org
186
187
188++pc7
189
190menu = pc7
191title = Virtual Machine 7
192host = pc7.ws.nsrc.org
193
194
195++pc8
196
197menu = pc8
198title = Virtual Machine 8
199host = pc8.ws.nsrc.org</code></pre>
200<p>Add as many PCs as you want, then Save and exit from the Targets file and verify that the changes you have made are working:</p>
201<pre><code># service smokeping reload</code></pre>
202<p>You can continue to view the updated results of your changes on the Smokeping web page. It may take up to 5 minutes before graphs begin to appear.</p>
203<pre><code>http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi</code></pre>
204<h2 id="configure-monitoring-of-routers-and-switches"><a href="#configure-monitoring-of-routers-and-switches"><span class="header-section-number">0.5</span> 4. Configure monitoring of routers and switches</a></h2>
205<p>Once you have configured as many PCs as you want to configure, then it's time to add in some entries for the classroom routers and switch(es).</p>
206<pre><code># cd /etc/smokeping/config.d        (just to be sure :-))
207# editor Targets</code></pre>
208<p>Go to the bottom of the file and add in some entries for routers and switches:</p>
209<pre><code>#
210# ********** Classroom Backbone Switch *********
211#
212
213+Switches
214
215menu = Switches
216title = Switches Network Management
217
218++sw
219
220menu = sw
221title = Backbone Switch
222host = sw.ws.nsrc.org
223
224#
225# ********** Virtual Routers: Cisco 7200 images *********
226#
227
228+Routers
229
230menu = Routers
231title = Virtual and Physical Routers Network Management
232
233++gw
234
235menu = gw
236title = Gateway Router
237host = gw.ws.nsrc.org
238
239++router1
240
241menu = router1
242title = Virtual Router 1
243host = rtr1.ws.nsrc.org
244
245++router2
246
247menu = router2
248title = Virtual Router 2
249host = rtr2.ws.nsrc.org
250
251++router3
252
253menu = router3
254title = Virtual Router 3
255host = rtr3.ws.nsrc.org</code></pre>
256<p>If you wish you can continue and add in entries for routers 4 to 6, or up to 9 if there are that many in your class. When you are ready Save and Exit from the Targets file and verify your work:</p>
257<pre><code># service smokeping reload</code></pre>
258<p>If you want you might consider adding the Wireless Access Point:</p>
259<pre><code># editor Targets</code></pre>
260<pre><code>#
261# Classrom Wireless Access Point
262#
263
264++ap1
265
266menu = ap1
267title = Wireless Access Point 1
268host = ap1.ws.nsrc.org</code></pre>
269<p>Save and Exit from the file and reload the Smokeping service:</p>
270<pre><code># service smokeping reload</code></pre>
271</body>
272</html>