This document will explain MIB management in the ZenOss console and how to add new MIBs into the organizer. I wrote this document because the admin guide is not clear and does not provide much in troubleshooting help.
Background Information
There are a few things to note before you actually get into installing and managing MIBs that should be handled before you begin.
- All work should be performed from the command line in an SSH console on the ZenOss server. MIB management from the web UI is not recommended.
- MIB management should be treated as a slow and methodical process. It should not be viewed as quick and dirty. Take your time and you will be more successful. This means don't try and load 1000 MIBs all at once. Try in increments of 3 to 5 at a time.
- You should install the MIB Utils Community ZenPack. It is a very well designed ZenPack which will provide you a tree-view of the OIDs in a MIB.
- The base instructions below were written based off of a binary install of ZenOss 2.3.2 on an Ubuntu 8.10 Server using the defaults during the installation. The other stack installers and especially the virtual appliance may have a different behavior.
- [Virtual Appliance Notes...]
- [Red Hat Enterprise Linux Notes...]
- [CentOS Notes...]
- [Other Notes....]
- The primary environment variable that services the MIB load process (zenmib) is SMIPATH. Assuming that ZenOss is installed in /usr/local/zenoss, the variable should be (by default):
SMIPATH=/usr/local/zenoss/common/share/snmp/mibs:/usr/local/zenoss/common/share/mibs/iana:/usr/local/zenoss/common/share/mibs/ietf:/usr/local/zenoss/common/share/mibs/irtf:/usr/local/zenoss/common/share/mibs/site:/usr/local/zenoss/common/share/mibs/tubs
TIP: You can enter the "env" command to see the current set of environment variables.
- You can add this command to the ZenOss user's .profile home directory based file to be loaded when you logon with su (sudo). E.g.
sudo su zenoss
- To ensure that MIB importing works (no matter the platform), run the following commands to establish some symbolic links (assuming $ZENHOME is /usr/local/zenoss/zenoss):
cd $ZENHOME
ln -s /usr/local/zenoss/common/share
ln -s /usr/local/zenoss/common/libexec
Okay, with all that out of the way, let's get into some procedures.
Base Installed MIBs - Viewing in the MIB Organizer
ZenOss comes with a good deal of MIBs installed in $ZENHOME/../common/share/mibs in the following directories:
- iana: MIBS from the Internet Address Numbering Authority
- ietf: MIBS form the Internet Engineering Task Force (from all those RFCs)
- irtf: Unknown, not a set of MIBs
- site: Empty, this is where you install/copy new MIBs. See the next section
- tubs: Experimental Linux MIBS from the Technical University of Braunschweig, Germany
When ZenOss is installed, the base MIBs do not show up in the organizer (Under Management / Mibs). To aid in seeing the full OID tree of all MIBs installed, it is necessary to load the default MIBs into the organizer. This is useful for many reasons, but mostly for aiding you in seeing all OIDs available to the solution. ZenOss only needs MIBs loaded for SNMP trap/notification OID to name translation. The rest is extra. I have found this extra to be very helpful when building performance templates and other things that need an OID.
NOTE: This procedure assumes that $ZENHOME is in /usr/local/zenoss/zenoss.
- Start by creating the same structure in the organizer as in the filesystem.
- Click the down arrow next to "Sub-Folders" title and then choose "Add New Organizer".
- Enter "IANA", "IETF", "SITE" and "TUBS" in each of the four times you choose the menu item into the ID dialog box.
- Open an SSH connection to the server.
- SU (SUDO) to the ZenOss user.
- Ensure that a good SMIPATH environment variable is in the memory of the ZenOss user. See Background Information above for details.
- cd to $ZENHOME/../common/share/mibs/iana
- Enter this command:
/usr/local/zenoss/zenoss/bin/zenmib run *
- Wait for the process to finish.
- Go back to the web UI organzizer (Under Management / Mibs)
- Select all of the MIBs and then select "Move Mibs" from the MIBs menu. Select the /IANA root organizer folder.
- Repeat steps 5 to 9 for IETF and TUBS. The IETF and TUBS MIBs will be moved to the same respective root organizers.
Adding new MIBs
Adding new MIBs into the organizer is not as straightforward as the admin guide would like you to believe. This procedure should help.
- SFTP the MIB or a compressed (ZIP, TAR.GZ) archive of the MIB(s) to the server. The preferrable location is your user home directory. For the sake of this example, assume the user is jwrober, the archive is MSFT-MIB.ZIP and $ZENHOME is /usr/local/zenoss/zenoss.
- Open an SSH connection to the server.
- Issue this command:
mkdir mibs
- Issue this command:
cd mibs
- Issue this command:
unzip ../MSFT-MIB.ZIP
- A listing (ls) of the directory should show one file "MSFT-MIB.mib".
- SU (SUDO) to the ZenOss user.
- Issue this command:
cd /home/jwrober/mibs
- Issue this command to amend the SMIPATH environment variable:
export SMIPATH=/usr/local/zenoss/common/share/snmp/mibs:/usr/local/zenoss/common/share/mibs/iana:/usr/local/zenoss/common/share/mibs/ietf:/usr/local/zenoss/common/share/mibs/irtf:/usr/local/zenoss/common/share/mibs/site:/usr/local/zenoss/common/share/mibs/tubs:/home/jwrober/mibs
- Enter this command
/usr/local/zenoss/zenoss/bin/zenmib run *
- Wait for the process to finish. See Tips or Troubleshooting below if you get an error.
- Go into the web UI organizer (Under Management / Mibs).
- Under the root sub-folder organizer "SITE", create a new folder named "MICROSOFT"
- Move the MSFT-MIB from the root organizer (/Mibs) to the new folder (/Mibs/SITE/MICROSOFT)
- Issue this command
cp * /usr/local/zenoss/common/share/mibs/site
- Issue this command
exit
You should now be out of the zenoss user and back to your regular user account. - Issue this command
rm *
- The /home/jwrober/mibs directory should now be empty and ready for the next MIB or set of MIBs.
- There might be some zip or other archive files that were SFTPd over that need to be removed (rm) as well.
Some Tips:
- You can import multiple MIBs at the same time. The archive file can contain multiple MIBs and all of them can be imported at once. Be careful not to attempt to load too many MIBs at once. This will cause you more confusion as to what actually made it in okay, versus not okay. zenmib does not have a limit as far as the author knows.
- You might get an error message that zenmib can't find a MIB with a certain support name. Re-run the zenmib run command a second time to see if the error goes away.
- See the troubleshooting table below for extra assistance.
Troubleshooting
This is the troubleshooting section.
Error / Issue | Description / Resolution |
Unable to find a file providing the MIB [MIB NAME] | MIBs can get information from other MIBs using an IMPORTS directive at the top of the file. This error indicates that zenmib cannot find the [MIB NAME] denoted in the error. There are two ways to get around this error. 1. If you know for sure that [MIB NAME] is loaded on the server, then simply preface the full path to the MIB in front of the * on the zenmib command line. For example: if the [MIB NAME] is RFC-1215, then the new zenmib command would be: .../zenmib /usr/local/zenoss/common/share/mibs/ieft/RFC-1215 * If you don't know if the MIB is already loaded, you can search for the name in the ZenOss MIBs organizer UI. 2. If you know for sure that [MIB NAME] is NOT loaded on the server, then you have to go find it. A good resource for MIBs is at ByteSphere. Find the MIB, download it, and SFTP it to the working directory being used (the example procedure assumes /home/jwrober/mibs). Run the standard zenmib command (.../zenmib run *) again to see if it is picked up. Zenmib is good at picking up the dependencies in order needed if they are found in the SMIPATH variable. That is why we explicity define our working directory as part of the load process. If you continue to get the error for different [MIB NAME]s, then continue to go find and consolidate all the MIBs you need to make zenmib happy. You can run zenmib as many times as you need without hurting ZenOss. Nothing is compiled until all the dependancies are taken care of. You can also use the trick in #1 above to explicity define the MIBs in order of error. You can string them all together in one long command line with the last thing being *. Make sure you periodically check the Web UI (/Mibs) to make sure that no MIBs were loaded by accident. If you are following the procedures in this document, there should never be any compiled MIBs in the root organizer (/Mibs). All MIBs should be moved to a sub-folder organizer. |
SyntaxError: invalid syntax | zenmib can throw this error at the end of a bunch of "junk". Here is an example of the whole error w/ "junk": Traceback (most recent call last): Here are some steps to get help with troubleshooting this error:
|
ZenMib imports with no errors, but the compiled MIB shows zero nodes or notifications | At this point in the author's research, the issue seems to be with zenmib not searching the zeodb for a previously loaded MIB. If you get this condition the MIB is probably loaded already. Look through the sub-folders in the organizer for the same MIB name. |
TODO:
- Add a section for creating, exporting and importing a MIB ZenPack
- Find more errors for the troubleshooting section.
- Add a section for any defects related to zenmib.