Skip navigation
Currently Being Moderated

How To Manage MIBs in ZenOss

VERSION 1 
Created on: Sep 14, 2009 11:21 AM by Noel Brockett - Last Modified:  Sep 14, 2009 11:21 AM by Noel Brockett

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.

 

  1. 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.
  2. Open an SSH connection to the server.
  3. SU (SUDO) to the ZenOss user.
  4. Ensure that a good SMIPATH environment variable is in the memory of the ZenOss user.  See Background Information above for details.
  5. cd to $ZENHOME/../common/share/mibs/iana
  6. Enter this command:
    /usr/local/zenoss/zenoss/bin/zenmib run *
  7. Wait for the process to finish.
  8. Go back to the web UI organzizer (Under Management / Mibs)
  9. Select all of the MIBs and then select "Move Mibs" from the MIBs menu.  Select the /IANA root organizer folder.
  10. 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.

 

  1. 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.
  2. Open an SSH connection to the server.
  3. Issue this command:
    mkdir mibs
  4. Issue this command:
    cd mibs
  5. Issue this command:
    unzip ../MSFT-MIB.ZIP
  6. A listing (ls) of the directory should show one file "MSFT-MIB.mib".
  7. SU (SUDO) to the ZenOss user.
  8. Issue this command:
    cd /home/jwrober/mibs
  9. 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
  10. Enter this command
    /usr/local/zenoss/zenoss/bin/zenmib run *
  11. Wait for the process to finish.  See Tips or Troubleshooting below if you get an error.
  12. Go into the web UI organizer (Under Management / Mibs).
  13. Under the root sub-folder organizer "SITE", create a new folder named "MICROSOFT"
  14. Move the MSFT-MIB from the root organizer (/Mibs) to the new folder (/Mibs/SITE/MICROSOFT)
  15. Issue this command
    cp * /usr/local/zenoss/common/share/mibs/site
  16. Issue this command
    exit
    You should now be out of the zenoss user and back to your regular user account.
  17. Issue this command
    rm *
  18. The /home/jwrober/mibs directory should now be empty and ready for the next MIB or set of MIBs.
  19. 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 / IssueDescription / 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):
  File "/usr/local/zenoss/zenoss/Products/ZenModel/zenmib.py", line 157, in load
    self.load1(mibs, mibname, depMap)
  File "/usr/local/zenoss/zenoss/Products/ZenModel/zenmib.py", line 112, in load1
    exec os.popen(dump) in result
  File "smidump -fpython -p "/usr/local/zenoss/zenoss/../common/share/mibs/ietf/RFC-1212" -p "/usr/local/zenoss/zenoss/../common/share/mibs/ietf/RFC1155-SMI" -p "/usr/local/zenoss/zenoss/../common/share/mibs/ietf/RFC1158-MIB" -p "/usr/local/zenoss/zenoss/../common/share/mibs/ietf/RFC-1215" -p "UMS-MIB.mib" "CIMWIN32-MIB.mib" 2>/dev/null", line 1785
      """The Architecture property indicates the instruction set architecture of the processor. Values are: 0=\, 1=\, 2=\, 3=\""",
             "reference>" :
                 """Win32_Processor.Architecture""",

                                  ^

SyntaxError: invalid syntax

Here are some steps to get help with troubleshooting this error:

  1. Open a second SSH sessions to the server.  One should already be open and SUDO'd to the zenoss user.  The second session will just be your regular user ID.
  2. In the second session, cd to the mibs working directory and issue this command:
    nano [MIB FILE NAME]
    TIP: nano is a text editor that comes with Ubuntu server.  You can also use vim if you are more comfortable with that editor.
  3. Find the string in the last line that is above the ^ symbol in the error.
  4. The syntax error is usually two lines up.  In this example, the syntax error is the =\ characters.
  5. Remove the chars and then save the file.
  6. Go back to the zenoss SSH session and issue the zenmib command (.../zenmib run *) command again and see what happens.
ZenMib imports with no errors, but the compiled MIB shows zero nodes or notificationsAt 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.
Comments (4)