149
7.2.3.2 SNMP traps
Before you begin using tkined for SNMP-based monitoring, you want to make sure the appropriate MIBs are installed. These will usually be located in a common mibs directory under the tnm library
directory, e.g., usrlibtnm2.1.10mibs or usrlocallibtnm2.1.10mibs. You will want to copy any enterprise MIB you plan to use to that directory. Next, you should verify that the files are compatible.
Try loading them into scotty with the mib load command, e.g., mib load toaster.mib. If the file loads without comment, you are probably OK. Finally, you will want to edit the init.tcl file to automatically
load the MIBs. Ideally, you will have a site-specific version of the file for changes, but you can edit the standard default file. You will want to add a line that looks something like
lappend tnmmibs
toaster.mib
. You are now ready to start tkined and do SNMP-based monitoring. The first step is to go to Tools
SNMP-Monitor. This will add the SNMP-Monitor menu to the menu bar. This menu is shown in
Figure 7-7 . To receive traps, select SNMP-Monitor
Trap Sink. A pop-up box will give you the option of listening to or ignoring traps. Select the Listen button and click
on Accept to start receiving traps. At this point, the station is now configured to receive traps.
Figure 7-7. SNMP-Monitor menu
150
To test that this is really working, we need to generate some traps for the system to receive. If you are a scotty user, you might use the code presented in the last section. For this example, a UPS that was
being monitored was unplugged. Regardless of how the trap is generated, tkined responds in the same way. The device icon blinks, a message is written on the map, and a new window, shown in
Figure 7-8 ,
is displayed with the trap messages generated by the UPS. Note that the duration of this problem was under 5 seconds. It is likely this event would have been missed with polling.
Figure 7-8. SNMP monitor report
7.2.3.3 Examining MIBs
Tools SNMP Tree provides one way of examining MIBs. Or, if you prefer, you can use Tools
SNMP-Browser. The SNMP Tree command displays a graphical representation of a subtree of the MIB. This is shown in
Figure 7-9 .
Figure 7-9. SNMP tree
151
Menu items allow you to focus in on a particular subtree. For example, the MIB-2 menu shows the various subtrees under the MIB-2 node. The Enterprises menu shows various enterprise MIBs that
have been loaded. You simply select the MIB of interest from the menu, and it will be displayed in the window. You can click on an item on the tree and a pop-up window will give you the option of
displaying a description of the item, retrieving its value, changing its value, or displaying just the subtree of the node in question. Of course, you will need to select a system before you can retrieve
system-specific information.
The SNMP-Browser option provides much the same functionality but displays information in a different format. If you select SNMP-Browser
MIB Browser, you will be given a text box listing the nodes below the internet node .1.3.6.1 of the MIB tree. If you click on any of these nodes, the
text box will be replaced with one of the nodes under the selected node. In this manner, you can move down the MIB tree. After the first box, you will also be given the option to move up the tree or, if
appropriate, to the previous or next node in the subtree. If you reach a leaf, you will be given a description of the object, as shown in
Figure 7-10 . If the object can be changed, you will be given that
choice as well.
Figure 7-10. MIB Browser
TE AM
FL Y
Team-Fly
®
152
You are also given the option to walk a subtree. This option will attempt to retrieve all the object values for leaves under the current node. This can be quite lengthy depending on where you are in the
tree. Figure 7-11
shows the last few entries under ip. Most of the values have scrolled off the window.
Figure 7-11. Walk for IP
SNMP Tree provides a nice visual display, but it can be a little easier to move around with the MIB Browser. Take your choice.
7.2.3.4 Monitoring SNMP objects