1 | Smokeping Exercises |
---|
2 | |
---|
3 | Network Monitoring and Management |
---|
4 | |
---|
5 | Smokeping |
---|
6 | --------- |
---|
7 | |
---|
8 | Notes: |
---|
9 | ------ |
---|
10 | * Commands preceded with "$" imply that you should execute the command as |
---|
11 | a general user - not as root. |
---|
12 | * Commands preceded with "#" imply that you should be working as root. |
---|
13 | * Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>") |
---|
14 | imply that you are executing commands on remote equipment, or within |
---|
15 | another program. |
---|
16 | |
---|
17 | Exercises |
---|
18 | ---------- |
---|
19 | |
---|
20 | 0. Log in to your PC or open a terminal window as the sysadmn user. |
---|
21 | |
---|
22 | Once you are logged in you can continue with these exercises. |
---|
23 | |
---|
24 | 1. Install Smokeping |
---|
25 | |
---|
26 | $ sudo apt-get install smokeping |
---|
27 | |
---|
28 | 2. Initial Configuration |
---|
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 | $ sudo vi General |
---|
43 | |
---|
44 | Change the following lines: |
---|
45 | |
---|
46 | owner = NOC |
---|
47 | contact = sysadm@localhost |
---|
48 | cgiurl = http://localhost/cgi-bin/smokeping.cgi |
---|
49 | mailhost = localhost |
---|
50 | |
---|
51 | Save the file and exit. Now let's restart the |
---|
52 | Smokeping service to verify that no mistakes have been made |
---|
53 | before going any further: |
---|
54 | |
---|
55 | $ sudo service smokeping restart |
---|
56 | |
---|
57 | 2. Configure monitoring of devices |
---|
58 | |
---|
59 | The majority of your time and work configuring Smokeping |
---|
60 | will be done in the file /etc/smokeping/config.d/Targets. |
---|
61 | |
---|
62 | For this class please do the following: |
---|
63 | |
---|
64 | Use the default FPing probe to check: |
---|
65 | |
---|
66 | - all the PCs in your group |
---|
67 | - classroom NOC |
---|
68 | - switches |
---|
69 | - routers |
---|
70 | |
---|
71 | You can use the classroom Network Diagram on the classroom wiki to |
---|
72 | figure out addresses for each item, etc. |
---|
73 | |
---|
74 | Create some hierarchy to the Smokeping menu for your |
---|
75 | checks. Such as: |
---|
76 | |
---|
77 | +Local |
---|
78 | |
---|
79 | menu = Network Monitoring and Management |
---|
80 | title = NOC Server for Network Monitoring Class |
---|
81 | |
---|
82 | ++LocalMachine |
---|
83 | |
---|
84 | menu = The NOC@NetManage |
---|
85 | title = The NOC@NetManage |
---|
86 | host = localhost |
---|
87 | |
---|
88 | # |
---|
89 | # Classroom PCs |
---|
90 | # |
---|
91 | |
---|
92 | ++PCs |
---|
93 | |
---|
94 | +++pc1 |
---|
95 | menu = pc1 |
---|
96 | title = pc1 |
---|
97 | host = pc1 |
---|
98 | |
---|
99 | +++pc2 |
---|
100 | menu = pc2 |
---|
101 | title = pc2 |
---|
102 | host = pc2 |
---|
103 | |
---|
104 | Save the file and restart Smokeping: |
---|
105 | |
---|
106 | $ sudo service smokeping restart |
---|
107 | |
---|
108 | Go to your browser and check the Smokeping page: |
---|
109 | |
---|
110 | http://pcN.ws.nsrc.org/cgi-bin/smokeping.cgi |
---|
111 | |
---|
112 | If everything is looking OK, continue adding: |
---|
113 | |
---|
114 | ++Routers |
---|
115 | |
---|
116 | +++rtr |
---|
117 | menu = rtr |
---|
118 | title = Gateway Router |
---|
119 | host = rtr |
---|
120 | |
---|
121 | +++rtr1 |
---|
122 | menu = rtr1 |
---|
123 | title = Router 1, Group 1 |
---|
124 | host = rtr1 |
---|
125 | |
---|
126 | ++Switch |
---|
127 | |
---|
128 | ++sw |
---|
129 | menu = sw |
---|
130 | title = Backbone Switch |
---|
131 | host = sw |
---|
132 | |
---|
133 | ... |
---|
134 | |
---|
135 | Save the file, restart smokeping, and check |
---|
136 | your browser again. |
---|
137 | |
---|
138 | 3. Add new probes |
---|
139 | |
---|
140 | The current entry in Probes is fine, but if you wish to |
---|
141 | use additional Smokeping checks you can add them in here |
---|
142 | and you can specify their default behavior. You can do |
---|
143 | this, as well, in the Targets file if you wish. |
---|
144 | |
---|
145 | Here is an example of a Probes file that would specify |
---|
146 | what to use to check for HTTP and DNS latency as well as |
---|
147 | the FPing probe that is used for ping latency: |
---|
148 | |
---|
149 | $ sudo vi Probes |
---|
150 | |
---|
151 | *** Probes *** |
---|
152 | |
---|
153 | + FPing |
---|
154 | |
---|
155 | binary = /usr/bin/fping |
---|
156 | |
---|
157 | + EchoPingHttp |
---|
158 | |
---|
159 | + DNS |
---|
160 | binary = /usr/bin/dig |
---|
161 | pings = 5 |
---|
162 | step = 180 |
---|
163 | lookup = www.nsrc.org |
---|
164 | |
---|
165 | Save the file. |
---|
166 | |
---|
167 | 4. Add HTTP latency checks |
---|
168 | |
---|
169 | Now edit your Targets again: |
---|
170 | |
---|
171 | $ sudo vi Targets |
---|
172 | |
---|
173 | Add a check for HTTP latency for all the classroom PCs. |
---|
174 | This will mean adding another category, such as: |
---|
175 | |
---|
176 | ++HTTP Servers |
---|
177 | probe = EchoPingHttp |
---|
178 | menu = HTTP Response |
---|
179 | title = HTTP Response Student PCs |
---|
180 | |
---|
181 | +++pc1 |
---|
182 | menu = pc1 |
---|
183 | title = PC1 HTTP Response Time |
---|
184 | host = pc1 |
---|
185 | |
---|
186 | +++pc1 |
---|
187 | host = pc2 |
---|
188 | title = PC2 HTTP Response Time |
---|
189 | host = pc2 |
---|
190 | |
---|
191 | ... |
---|
192 | |
---|
193 | If you have time, consider checking some machines that are |
---|
194 | external to our classroom and the conference (your organization's |
---|
195 | website, a popular web page, etc...) |
---|
196 | |
---|
197 | 5. Add DNS Latency Checks |
---|
198 | |
---|
199 | You can check either or both internal or external names using |
---|
200 | the DNS latency probe. |
---|
201 | |
---|
202 | Add a menu hierarchy for DNS Latency. Check an external address |
---|
203 | (nsrc.org) and an internal address (noc). This will look something |
---|
204 | like this (in Targets): |
---|
205 | |
---|
206 | +DNS |
---|
207 | probe = DNS |
---|
208 | menu = External DNS Check |
---|
209 | title = DNS Latency |
---|
210 | |
---|
211 | ++nsrc |
---|
212 | host = nsrc.org |
---|
213 | |
---|
214 | ++noc |
---|
215 | host = noc.mgmt |
---|
216 | |
---|
217 | Exit and save your changes to the file Targets. |
---|
218 | |
---|
219 | Restart Smokeping to see the changes: |
---|
220 | |
---|
221 | $ sudo service smokeping restart |
---|
222 | |
---|
223 | Look at additional Smokeping probes and consider implementing |
---|
224 | some of them: |
---|
225 | |
---|
226 | http://oss.oetiker.ch/smokeping/probe/index.en.html |
---|
227 | |
---|
228 | As trying to explain all syntactical details of how the file |
---|
229 | /etc/smokeping/config.d/Targets is used would require several |
---|
230 | pages we will go through some examples in class, and you can |
---|
231 | refer to the Smokeping configuration files that are in use on |
---|
232 | the classroom NOC box by going to: |
---|
233 | |
---|
234 | http://noc/configs/etc/smokeping |
---|
235 | http://noc/configs/etc/smokeping/config.d |
---|
236 | |
---|