1 | Observium lab |
---|
2 | ------------- |
---|
3 | |
---|
4 | All components for Observium should already be installed - it will be |
---|
5 | now up to you to configure the service, add hosts, etc... |
---|
6 | |
---|
7 | If this is not the case, a different lab (observium-install.txt) is |
---|
8 | available. Follow the instructions in this lab to complete the initial |
---|
9 | Observium installation. |
---|
10 | |
---|
11 | Connect to your PC, then: |
---|
12 | |
---|
13 | 1. Create an Apache virtual host to use with Observium |
---|
14 | (or edit it, if it's already there) |
---|
15 | ----------------------------------- |
---|
16 | |
---|
17 | Make sure that the name "observiumX.ws.nsrc.org", where X is the |
---|
18 | number of your machine, works: |
---|
19 | |
---|
20 | $ ping observiumX.ws.nsrc.org |
---|
21 | PING observiumX.ws.nsrc.org (10.10.X.X): 56 data bytes |
---|
22 | 64 bytes from 10.10.X.X: icmp_seq=0 ttl=63 time=5.232 ms |
---|
23 | 64 bytes from 10.10.X.X: icmp_seq=1 ttl=63 time=4.681 ms |
---|
24 | ^C |
---|
25 | |
---|
26 | (Of course this will only work if the DNS for your class has been set up |
---|
27 | to with entries for your Observium virtual hosts, which your instructors |
---|
28 | should have done). |
---|
29 | |
---|
30 | $ cd /etc/apache2/sites-available |
---|
31 | $ sudo editor observium |
---|
32 | |
---|
33 | In this file add the following: |
---|
34 | |
---|
35 | <VirtualHost *:80> |
---|
36 | DocumentRoot /opt/observium/html/ |
---|
37 | ServerName observiumX.ws.nsrc.org |
---|
38 | CustomLog /opt/observium/logs/access_log combined |
---|
39 | ErrorLog /opt/observium/logs/error_log |
---|
40 | <Directory "/opt/observium/html/"> |
---|
41 | AllowOverride All |
---|
42 | Options FollowSymLinks MultiViews |
---|
43 | </Directory> |
---|
44 | </VirtualHost> |
---|
45 | |
---|
46 | Note the line that reads: |
---|
47 | |
---|
48 | ServerName observiumX.ws.nsrc.org |
---|
49 | |
---|
50 | ... and replace "X" with the number of your PC. |
---|
51 | |
---|
52 | Save the file and exit. |
---|
53 | |
---|
54 | 2. Enable your new virtual host |
---|
55 | ------------------------------- |
---|
56 | |
---|
57 | $ sudo a2ensite observium |
---|
58 | $ sudo apachectl graceful |
---|
59 | |
---|
60 | 3. Access Observium! |
---|
61 | -------------------- |
---|
62 | |
---|
63 | A user has already been created for you. This is the user 'admin', and |
---|
64 | the password is the standard class password: |
---|
65 | |
---|
66 | http://observiumX.ws.nsrc.org/ |
---|
67 | |
---|
68 | User: admin |
---|
69 | Password: the class password |
---|
70 | |
---|
71 | You should now be logged in to Observium. There should not be any devices |
---|
72 | configured. Take a look at the interface for a few minutes. |
---|
73 | |
---|
74 | 4. Edit the configuration file for Observium, to tell it about our network |
---|
75 | -------------------------------------------------------------------------- |
---|
76 | |
---|
77 | $ sudo editor /opt/observium/config.php |
---|
78 | |
---|
79 | Now make the following changes: |
---|
80 | |
---|
81 | Find the line: |
---|
82 | |
---|
83 | $config['snmp']['community'] = array("public"); |
---|
84 | |
---|
85 | ... and change 'public' to 'NetManage' (NOT "netmanage" or "NETMANAGE"), so |
---|
86 | it looks like this: |
---|
87 | |
---|
88 | $config['snmp']['community'] = array("NetManage"); |
---|
89 | |
---|
90 | Now find the two lines (near the end): |
---|
91 | |
---|
92 | $config['nets'][] = "172.22.0.0/16"; |
---|
93 | $config['nets'][] = "192.168.0.0/24"; |
---|
94 | |
---|
95 | ... and replace them with: |
---|
96 | |
---|
97 | $config['nets'][] = "10.10.0.0/24"; |
---|
98 | |
---|
99 | ... notice that we only have ONE network for now: the backbone. We'll configure |
---|
100 | more networks later! |
---|
101 | |
---|
102 | Optionnally, you can change the part of the world the map will show |
---|
103 | when you log into observium. |
---|
104 | |
---|
105 | Look at the parameters for this listed at |
---|
106 | |
---|
107 | http://www.observium.org/wiki/Configuration_Options#Map_overview_settings |
---|
108 | |
---|
109 | In particular, $config['frontpage']['map']['region'] can be |
---|
110 | set to a particular country or region. There is more information |
---|
111 | at https://developers.google.com/chart/interactive/docs/gallery/geochart |
---|
112 | |
---|
113 | (See end of this file for more info) |
---|
114 | |
---|
115 | Save the file and exit. |
---|
116 | |
---|
117 | 5. Add a host - your own router |
---|
118 | ------------------------------- |
---|
119 | |
---|
120 | $ cd /opt/observium |
---|
121 | $ ./addhost.php rtrX.ws.nsrc.org NetManage v2c |
---|
122 | |
---|
123 | (Notice that here we use the HOSTNAME and NOT the IP of the host!) |
---|
124 | |
---|
125 | Check on the Web interface that the host has been found: |
---|
126 | |
---|
127 | http://observiumX.ws.nsrc.org/devices/ |
---|
128 | |
---|
129 | ... you can explore the web interface for a few minutes - but there is no |
---|
130 | data yet! |
---|
131 | |
---|
132 | We can tell Observium to start collecting data for this host, by running the |
---|
133 | following command: |
---|
134 | |
---|
135 | $ sudo ./poller.php -h all |
---|
136 | |
---|
137 | ... Of course, we don't want to do this manually! We will automate this in the |
---|
138 | next steps. |
---|
139 | |
---|
140 | 6. Tell Observium to run a discovery (scan) of the network, and start |
---|
141 | collecting data |
---|
142 | --------------------------------------------------------------------- |
---|
143 | |
---|
144 | $ cd /opt/observium |
---|
145 | $ sudo ./discovery.php -h all |
---|
146 | |
---|
147 | Note that a LOT of information will appear! |
---|
148 | |
---|
149 | We'll run a data collection again manually: |
---|
150 | |
---|
151 | $ sudo ./poller.php -h all |
---|
152 | |
---|
153 | |
---|
154 | 7. Go back to the web interface |
---|
155 | ------------------------------- |
---|
156 | |
---|
157 | http://observiumX.ws.nsrc.org/ |
---|
158 | |
---|
159 | What do you notice ? How do you think Observium figured out what devices |
---|
160 | to monitor ? |
---|
161 | |
---|
162 | |
---|
163 | 8. Enable cron jobs |
---|
164 | ------------------- |
---|
165 | |
---|
166 | It's time to make the data collection happen automatically. |
---|
167 | |
---|
168 | A number of automated maintenance tasks need to be added: |
---|
169 | |
---|
170 | Create the file /etc/cron.d/observium: |
---|
171 | |
---|
172 | $ sudo editor /etc/cron.d/observium |
---|
173 | |
---|
174 | ... and paste the following lines: |
---|
175 | |
---|
176 | |
---|
177 | 33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1 |
---|
178 | */5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1 |
---|
179 | */5 * * * * root /opt/observium/poller.php -h all >> /dev/null 2>&1 |
---|
180 | |
---|
181 | |
---|
182 | It will take a little while for data to appear in the graphs. |
---|
183 | |
---|
184 | |
---|
185 | 9. While we wait for the traffic to appear, we can navigate the interface |
---|
186 | ------------------------------------------------------------------------- |
---|
187 | |
---|
188 | Go to http://observiumX.ws.nsrc.org/ |
---|
189 | |
---|
190 | Click on "Devices" in menu at the top. |
---|
191 | |
---|
192 | Find the router for your group in the list, and click on its name. |
---|
193 | |
---|
194 | You will land on the Overview page for your device. |
---|
195 | |
---|
196 | You will notice that Observium has automatically detected many, many |
---|
197 | things about your router! |
---|
198 | |
---|
199 | At the top, under your router's hostname, you will see a list of tabs, |
---|
200 | all of them presenting information about your device: |
---|
201 | |
---|
202 | Overview | Graphs | Health | Ports | Routing | Map | Inventory | Logs | Alerts |
---|
203 | |
---|
204 | Under "Graphs", you will see all information which can be presented in |
---|
205 | the form of a graph: Network IO, Disk IO, Memory and CPU usage, etc... |
---|
206 | |
---|
207 | You will also see the "Health" tab, which offers various metrics on |
---|
208 | how the device is doing hardware wise - if this information is available - |
---|
209 | such as temperature, voltage, fan speed, etc... Notice that some of this |
---|
210 | information is already shown in the overview page for the device (which |
---|
211 | you get when you click on the name of the device). |
---|
212 | |
---|
213 | Next we'll take a look at the Ports menu tab. Under "Ports" you will find |
---|
214 | a summary of traffic for all ports, including bits per second and packets |
---|
215 | per second, port speed, and the type of connection (Ethernet or other). |
---|
216 | |
---|
217 | Note that all elements can be clicked on, including the small graphs, and |
---|
218 | you will be taken to the corresponding page for the data source. |
---|
219 | |
---|
220 | The Routing tab will present you with an overview of enabled routing |
---|
221 | protocols. If you have enabled OSPF or BGP on your routers, you will |
---|
222 | get information about the active sessions, neighbors or peers, and |
---|
223 | other protocol specific information. |
---|
224 | |
---|
225 | The Map tab is an automatically generated diagram of the topology of |
---|
226 | your network, as seen from the point of view of your router. This will |
---|
227 | only function for CDP/LLDP enabled devices (Cisco, IOS, ...) |
---|
228 | |
---|
229 | Inventory contains a full list of hardware modules and serial numbers |
---|
230 | for equipment installed on your router. Note that this will not work on |
---|
231 | all vendors. |
---|
232 | |
---|
233 | Under Logs you will see a list of events for your router: changes that |
---|
234 | have taken place in the configuration of the device, or in the state |
---|
235 | of interfaces, services, etc... |
---|
236 | |
---|
237 | Alerts is currently empty for your router - we will see more about this |
---|
238 | later. |
---|
239 | |
---|
240 | |
---|
241 | 10. Add a location and contact for your router |
---|
242 | ----------------------------------------------- |
---|
243 | |
---|
244 | If you navigate back to the Overview page for your router |
---|
245 | (Go to Devices, click on your router's name), you will see that |
---|
246 | Observium has picked up the Hardware platform, the Operating System |
---|
247 | and the Uptime for your device. |
---|
248 | |
---|
249 | Now, log into your router with SSH and add the following information |
---|
250 | to your SNMP configuration: |
---|
251 | |
---|
252 | - Set the location (make it a City, Country format, so that your |
---|
253 | host will appear on the geo map overview page) |
---|
254 | |
---|
255 | - Set the contact (email address or name) |
---|
256 | |
---|
257 | To do this: |
---|
258 | |
---|
259 | rtr8> enable |
---|
260 | Password: |
---|
261 | rtr8# conf terminal |
---|
262 | Enter configuration commands, one per line. End with CNTL/Z. |
---|
263 | rtr8(config)# snmp-server contact user@email.address |
---|
264 | rtr8(config)# snmp-server location City, Country |
---|
265 | rtr8(config)# exit |
---|
266 | rtr8# write memory |
---|
267 | |
---|
268 | You want to replace "City, Country" with the city and country (or |
---|
269 | state) we are currently in. For example: |
---|
270 | |
---|
271 | Bloomington, Indiana |
---|
272 | Thimphu, Bhutan |
---|
273 | |
---|
274 | etc... |
---|
275 | |
---|
276 | If you wait a few minutes (maximum 5), you should see this information |
---|
277 | appear automatically on the Overview tab for your router in Observium. |
---|
278 | |
---|
279 | While you are still logged in to your router, add a pseudo interface |
---|
280 | to your router, to see if Observium will pick it up: |
---|
281 | |
---|
282 | rtr8(config)# interface loopback123 |
---|
283 | rtr8(config-if)# description A useless interface |
---|
284 | rtr8(config-if)# exit |
---|
285 | rtr8(config)# exit |
---|
286 | rtr8# write memory |
---|
287 | |
---|
288 | This should also show up in Observium after a while - try and |
---|
289 | find it under "Ports" |
---|
290 | |
---|
291 | |
---|
292 | 11. IP address lookup |
---|
293 | --------------------- |
---|
294 | |
---|
295 | From Observium's main page, you will find, under the Overview menu |
---|
296 | (at the TOP of the page), 4 options: |
---|
297 | |
---|
298 | IPv4 search -> http://observiumX.ws.nsrc.org/search/search=ipv4/ |
---|
299 | IPv6 search -> http://observiumX.ws.nsrc.org/search/search=ipv6/ |
---|
300 | MAC search -> http://observiumX.ws.nsrc.org/search/search=mac/ |
---|
301 | ARP tables -> http://observiumX.ws.nsrc.org/search/search=arp/ |
---|
302 | |
---|
303 | Using the IPv4 and ARP table searches, try and search IPs of |
---|
304 | equipment in the class: |
---|
305 | |
---|
306 | - IP of the GW (10.10.0.254) |
---|
307 | - IPs of the routers (10.10.0.X, 10.10.X.254) |
---|
308 | - IPs of the PCs (10.10.1.1, 10.10.5.17, etc...) |
---|
309 | |
---|
310 | - Try and search IPs for your OWN laptop! |
---|
311 | Find the IP of you own laptop, and see if you can search it in |
---|
312 | Observium. Can you ? Why ? |
---|
313 | |
---|
314 | |
---|
315 | 13. Add the switch |
---|
316 | ------------------- |
---|
317 | |
---|
318 | From the TOP menu "Devices", choose "Add device". |
---|
319 | |
---|
320 | Fill out the fields: |
---|
321 | |
---|
322 | Hostname: sw.ws.nsrc.org |
---|
323 | Community: NetManage |
---|
324 | |
---|
325 | Click on "Add Host". After a few seconds, it should have added the switch. |
---|
326 | After a few minutes, data should appear in Observium for the switch. |
---|
327 | |
---|
328 | Notice the "Ports" line at the TOP right of the Observium interface. |
---|
329 | |
---|
330 | Does it say that ports are down ? Which ones ? |
---|
331 | |
---|
332 | Try and click on the 'X down' ports message to see which ports are |
---|
333 | down on which devices. |
---|
334 | |
---|
335 | |
---|
336 | 14. Let's disable ports that are unused! |
---|
337 | ---------------------------------------- |
---|
338 | |
---|
339 | Find the Overview page for "sw.ws.nsrc.org". |
---|
340 | |
---|
341 | From there, you can configure the device (the "key" icon on the top |
---|
342 | right). You are then presented with a configuration page for the device. |
---|
343 | |
---|
344 | Click on Ports, then you will get an overview of the Port status |
---|
345 | on the switch. Look at the ones that are "down". |
---|
346 | |
---|
347 | For those that are "down", check the "Ignore" box, then "Save" |
---|
348 | under "Index". |
---|
349 | |
---|
350 | If you call back the main Observium page: |
---|
351 | |
---|
352 | http://observiumX.ws.nsrc.org/ |
---|
353 | |
---|
354 | ... Observium should no longer complain about these ports! |
---|
355 | |
---|
356 | |
---|
357 | 15. Have you tried adding your PC yet? Other PCs in the class? |
---|
358 | -------------------------------------------------------------- |
---|
359 | |
---|
360 | More fun things: |
---|
361 | |
---|
362 | - From the top menu, choose Devices -> All devices |
---|
363 | |
---|
364 | - Find your router, and click on it on the list. |
---|
365 | |
---|
366 | - Below the graph summary, you'll see a list of the interfaces on your router: |
---|
367 | |
---|
368 | Fa0/0, Fa0/1, Null0 |
---|
369 | |
---|
370 | - Click on Fa0/0 |
---|
371 | |
---|
372 | - Click on "Real Time" |
---|
373 | |
---|
374 | |
---|
375 | |
---|
376 | 16. Region settings for the map |
---|
377 | ------------------------------- |
---|
378 | |
---|
379 | In reference to the configuration settings in step 4. |
---|
380 | |
---|
381 | The parameter $config['frontpage']['map']['region'] can take |
---|
382 | multiple values. From: |
---|
383 | |
---|
384 | https://developers.google.com/chart/interactive/docs/gallery/geochart |
---|
385 | |
---|
386 | region: The area to display on the map. (Surrounding areas will be displayed |
---|
387 | as well.) Can be one of the following: |
---|
388 | |
---|
389 | * 'world' - A map of the entire world. |
---|
390 | * A continent or a sub-continent, specified by its 3-digit |
---|
391 | code, e.g., '011' for Western Africa. |
---|
392 | * A country, specified by its ISO 3166-1 alpha-2 code, e.g., |
---|
393 | 'AU' for Australia. |
---|
394 | * A state in the United States, specified by its ISO 3166-2:US |
---|
395 | code, e.g., 'US-AL' for Alabama. Note that the resolution |
---|
396 | option must be set to either 'provinces' or 'metros'. |
---|
397 | |
---|
398 | You can test these options by changing the parameter and reloading |
---|
399 | the overview page of Observium. |
---|