< Home

snmp-agent mib-view

Function

The snmp-agent mib-view command creates or updates a MIB view.

The undo snmp-agent mib-view command cancels the configuration of the current MIB view.

In SNMPv1 and SNMPv2c, the default MIB view name is the ViewDefault and the OID is 1.3.6.1. In SNMPv3, there is no default MIB view and must be configured.

Format

snmp-agent mib-view { excluded | included } view-name oid-tree

undo snmp-agent mib-view view-name [ oid-tree ]

undo snmp-agent mib-view [ excluded | included ] view-name [ oid-tree ]

Parameters

Parameter Description Value
excluded Indicates that the MIB view excludes the MIB subtree. -
included Indicates that the MIB view includes the MIB subtree. -
view-name Specifies the MIB view name.

The value is a string of 1 to 32 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

oid-tree Specifies the OID for the MIB subtree. oid-tree can be the OID (such as 1.4.5.3.1) or the name (such as system) of the subtree.

It is a string of 1 to 255 case-sensitive characters without spaces.

NOTE:

It must be a valid MIB subtree.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

Most SNMP configuration commands contain the parameter view-name. The snmp-agent mib-view command is used to create or update a view. You cannot modify or delete the default ViewDefault MIB view.

In the snmp-agent mib-view command, the parameter view-name can be displayed as an OID or an object name.
  • Displaying the parameter view-name as an OID: snmp-agent mib-view included myview 1.3.6.1.2.1.
  • Displaying the parameter view-name as an object name: snmp-agent mib-view excluded myview system.7.

To uniquely identify object identifiers in SNMP messages, SNMP uses a hierarchical naming structure to distinguish object identifiers from each other. This is a tree-like structure, with the nodes (such as {1.3.6.1.2.1}) representing object identifiers. The MIB is a collection of standard variables on monitored network devices.

You can select parameters based on the following rules:
  • excluded: If a few MIB objects on the device or some objects in the current MIB view do not or no longer need to be managed by the NM station, excluded needs to be specified in the command to exclude these MIB objects.

  • included: If a few MIB objects on the device or some objects in the current MIB view need to be managed by the NM station, included needs to be specified in the command to include these MIB objects.

If you forget which information you have configured for a MIB view, you can run the display snmp-agent mib-view command to check it.

Precautions

When you run the snmp-agent mib-view command for multiple times to define the MIB view, the new configuration overwrites the original configuration if the values of view-name and oid-tree are the same; the new and original configurations both take effect if the values of view-name and oid-tree are different. The system can store a maximum of 256 MIB view configurations, among which there are four default views.

If both the include and exclude parameters are configured for MIB objects that have an inclusion relationship, whether to include or exclude the lowest MIB object will be determined by the parameter configured for the lowest MIB object. For example, the snmpV2, snmpModules, and snmpUsmMIB objects are from top down in the MIB table. If the exclude parameter is configured for snmpUsmMIB objects and include is configured for snmpV2, snmpUsmMIB objects will still be excluded.

Example

# Create MIB view mib2view that includes all mib-2 objects and the subtree with the OID as 1.3.6.1.2.1.

<HUAWEI> system-view
[HUAWEI] snmp-agent mib-view included mib2view 1.3.6.1.2.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >