4.4 QUERYING THE MIBWhy query the MIB? NNM stores just a few MIB variables in its database. Much more information is readily available from the SNMP agent on the managed node. For instance, to find out where the device is physically located and who is responsible for managing it, you can customize the MIB variables for Location and Contact . Commonly, the NNM administrator customizes these using NNM. This will be discussed in more detail in Chapter 9. Better yet, what if you want to look at interface traffic in real-time on a managed node? ifInOctets and ifOutOctets are MIB variables that keep track of traffic coming in and going out of each interface. NNM provides a handy tool, the MIB browser, for browsing the set of variables on your network devices. To access the MIB browser, select from the menu bar Tools MIB 4.4.1 The MIB-II SubtreeFirst, let's take a look at the Management MIB subtree. The MIB-II subtree starts with the character representationSection 4.1.5.1, "Non-SNMP Devices." Figure 4-17. The MIB browser allows you to drill down the MIB tree. The[Start Query] button sends an SNMP request to the specified host. This figure illustrates the system branch of the Management MIB tree. You can also query the MIB using the command-line utilities snmpwalk, snmpbulk , and snmpget that ship with NNM. Using these commands, you would specify the node and either the character or numeric representation of the MIB variable. I like the using the numeric representation because it frequently requires less typing. For example, to query the system subtree: snmpwalk nodename .1.3.6.1.2.1.1 or snmpwalk nodename system Now drill down to the interfaces.ifTable.ifEntry subtree. Select ifInOctets and click the [Describe] button displayed on the right side of the MIB browser. This displays the numeric representation as well as a description of the MIB variable you have selected. See Figure 4-18 for the description of the variable ifInOctets . This provides excellent online documentation. Figure 4-18. The description of a MIB variable can be accessed from the MIB browser by selecting a variable and clicking the[Describe] button. Both the character and numeric representation of the MIB variable are displayed. 4.4.2 Graphing MIB VariablesYou can use another powerful NNM feature to graph MIB variables. Select a MIB variable such as ifInOctets and click the Graph button. This displays a real-time graph of that variable. NNM is now sending an snmpget to the node you've selected and displaying the information on the graph. You can graph two or more variables at once by holding the control key and left-clicking the desired variables. Refer to the graph of ifInOctets and ifOutOctets shown in Figure 4-19. Figure 4-19. MIB variables can be graphed by selecting a variable and clicking the[Graph] button from the MIB browser. Multiple variables may be graphed by simultaneously pressing the control key and left-clicking to select the desired variables. For every IP network interface on the selected system (including the loopback interface) you will see a variable for ifInOctets and ifOutOctets . The .1, .2, .3 extensions each indicate a different interface. Place the cursor over the graph and left-click it to customize it. You can zoom in, zoom out, page backward and forward. Further customization includes background color, time intervals, and polling frequency. When you right-click on the graph, you will see a timestamp line as shown in Figure 4-19. This can be used to align with interesting points (peaks and troughs) in network activity. 4.4.3 Loading Additional MIBs into NNMNNM ships with a subset of vendors' MIBs. However, these MIBs are not necessarily up-to-date because vendors are always coming out with new hardware and new MIBs. You'll need to get the latest version of MIBs from the vendor, put them in the $OV_SNMP_MIBS/Vendor directory, and select Options [Load…] button. Select Vendor and you will see a list the list from the $OV_SNMP_MIBS/Vendor directory as shown in Figure 4-21. Figure 4-20. Vendor-specific MIB variables extend the functionality of SNMP. They can be loaded into NNM by selectingOptions Figure 4-21. NNM provides a subset of vendor MIBs.Note Refer to the file ov.envvars.sh located in /opt/OV/bin for a listing of environment variables used by NNM. The $OV_SNMP_MIBS variable references the directory /var/opt/OV/share/snmp. For NNM on Windows, the file is ov.envvars.bat. For C shell users, the file is ov.envvars.csh. The ov.envvars.sh can be configured in /etc/profile and ov.envvars.csh configured in /etc/csh.login to set the NNM environment variables for everyone, no matter what shell is preferred by a user. After you've loaded the MIBs into NNM, you can use the MIB browser to query and graph the vendor-specific MIB variables. Some vendor software also includes trap definitions. If you are loading the MIB, most likely you will want to use the trap definitions that are assigned by the vendor. Otherwise, when the trap is sent it will be seen as "undefined" in the Alarm Browser. Follow the vendor-specific instructions to load vendor-specific traps. 4.4.3.1 The Need for Vendor-Specific MIBsBecause the standard MIB tree was written in a generic sense, it does not account for operating system-specific variables. Vendors can extend the functionality of SNMP by providing MIB variables specific to their equipment. Let's look at the Hewlett-Packard MIB variable computerSystemUsers. Use the MIB browser to navigate the private subtree to iso.org.dod.internet. private.enterprise.hp.nnm.system.computerSystem.general . Assuming that you have an HP-UX system on your network, enter a valid HP-UX hostname, as shown in Figure 4-22. Figure 4-22. The HP-UX MIB variablecomputerSystemUsers defines the number of users logged onto a system. The numeric representation of this MIB variable is .1.3.6.1.4.1.11.2.3.1.1.2 and can be retrieved by clicking the Note You can use the Edit Edit Select the variable computerSystemUsers and click [Start Query] . This will return the number of users logged on the system. While this MIB variable is specific to HP-UX, many vendors extend the functionality of SNMP by providing vendor-specific MIB variables. When loading vendor MIBs, you may run into dependencies on other MIBs. You should follow the vendor instructions for loading these MIBs into NNM so they are loaded in the correct order. 4.4.3.2 Vendor-specific Trap DefinitionsVendors frequently provide trap definitions for their equipment as well. The trap definitions also provide NNM with the ability to better manage the vendors' devices. Recall the example discussed earlier in this chapter in Section 4.1, "NNM Discovery," of a printer sending an SNMP trap when it runs out of paper. By providing traps specific to their equipment, the vendors extend the functionality of SNMP. Thus, NNM is able to manage the device more effectively. |