Applies To:

Show Versions Show Versions

sol13596: Creating custom MIB entries on the BIG-IP system
How-ToHow-To

Original Publication Date: 05/22/2012
Updated Date: 11/20/2013

Purpose

You should consider using this procedure under the following condition:

  • You want to add customized Management Information Base (MIB) entries to a BIG-IP system.

Prerequisites

You must meet the following prerequisites to use this procedure:

  • You can access the BIG-IP command line.
  • You are familiar with the Tool Command Language (TCL) scripting language.

Description

Starting in BIG-IP 11.2.0, you can add customized MIB entries to a BIG-IP system to provide visibility to statistics and information that are not available through standard BIG-IP MIBs. These statistics and information can help you make decisions about the system configuration.

Customized MIB entries can be defined in a TCL file named custom_mib.tcl that you create and save on the BIG-IP system in the /config/snmp/ directory. You must register the customized entries and provide callback to the newly registered entries using the register_mib TCL command. To do so, use the following format when you specify the register_mib command in the custom MIB file:

register_mib "<oid>" <callback> <type>

The three arguments for the register_mib command are described in the following table:

Argument
Description
oid
A customized OID with a format of .1.2.3.4 with a limit of four digits. The common root of a customized OID on the BIG-IP system is .1.3.6.1.4.1.3375.2.100.
callback
A TCL procedure that is called when the registered OID is browsed. The procedure cannot have any arguments. The return value of the procedure is returned for the registered OID entry.
type
The type of OID entry you are customizing. Four types are supported: INT, STRING, GAUGE, and COUNTER.

Procedures

Creating the MIB file and customized MIB entries

To create the MIB file and customized MIB entries on the BIG-IP system, perform the following procedure:

Impact of procedure: None

  1. Log in to the BIG-IP command line.
  2. Use a text editor to create a TCL file named /config/snmp/custom_mib.tcl.

    For example, to create the /config/snmp/custom_mib.tcl file using the vi text editor, type the following command:

    vi /config/snmp/custom_mib.tcl
  3. Add the custom entries you want to use to the /config/snmp/custom_mib.tcl file.

    Note: You must ensure the accuracy of the TCL procedures you use in the file. Avoid errors, such as infinite loops, which can affect how the snmpd process works.


    For example, the following sample TCL code creates two custom MIB entries:

    register_mib ".1" system_descr string
    register_mib ".2" uptime string
     
      proc system_descr {}
      {
      set status [catch {exec uname -a} result]
      return $result
      }
     
      proc uptime {}
      {
      set status [catch {exec uptime} result]
      return $result
      }
  4. Save the changes, and then exit the TCL file.

    Note: After you save the custom_mib.tcl file, you can modify the file at any time; however, your changes become effective only after you restart snmpd.
  5. Restart snmpd by typing the following command:

    bigstart restart snmpd


    Note: Customized MIB entries are registered. After you restart snmpd, you should see log entries similar to the following in the /var/log/snmpd.log file:

    custom mib initialization completed. total 2 custom mib entry registered

Using a MIB browser to obtain the values of the newly registered MIB entries

You can use an snmp MIB browser to query the newly-created entries. To use the snmpwalk MIB browser to obtain the values of the newly-registered MIB entries, perform the following procedure:

Impact of procedure: Performing the following procedure should not have a negative impact on your system.

  1. Log in to the command line.
  2. Use the snmpwalk command to query the newly registered MIB entry:

    For example, the following snmpwalk command queries the MIB entry in the previous sample TCL code:

    snmpwalk -Os -c public -v 1 localhost .1.3.6.1.4.1.3375.2.100.1

    The command output may look similar to the following:

    bigipTrafficMgmt.100.1.0 = STRING: "Linux B3900-R23-S43.lab.ss.f5net.com 2.6.32-131.21.1.el6.f5.x86_64 #1 SMP Wed May 9 19:19:39 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux"

Supplemental Information

Note: The following links take you to a resource outside of AskF5, and it is possible that the information may be removed without our knowledge.

Was this resource helpful in solving your issue?




NOTE: Please do not provide personal information.



Incorrect answer. Please try again: Please enter the words to the right: Please enter the numbers you hear:

Additional Comments (optional)