Objective

The Simple Network Management Protocol (SNMP) is an Internet-standard protocol used to manage devices on IP network. The SNMP messages are used to inspect and communicate information about managed objects. SNMP uses Management Information Bases (MIBs) to store available objects in a hierarchical or tr-structured namespace that contains object identifiers (OIDs). An OID identifies the information in the MIB hierarchy that can be read or set via SNMP.

SNMP Views are a subset of MIB objects that can be assigned to an SNMP access group to control write, read and notification privileges of SNMP users over MIB object information. A view is a user-defined label for a collection of MIB subtrees. Each subtree ID is defined by the OID of the root of the relevant subtrees.

This article provides instructions on how to configure the SNMP Views on your switch through the Command Line Interface (CLI) of the device. This can also be done through the web-based utility of the device. For instructions, click here.

Applicable Devices

- Sx300 Series

- Sx350 Series

- SG350X Series

- Sx500 Series

- Sx550X Series

Software Version

- 1.4.7.05 — Sx300, Sx500

- 2.2.8.04 —Sx350, SG350X, Sx550X

Configure SNMP Views on a Switch

Step 1. Access the CLI of the switch.

Note: In this example, PuTTY is the application used to access the switch CLI. The default username and password is cisco/cisco. If you have customized your credentials, use your username and password.

Step 2. Switch to Global Configuration mode by entering the configure terminal command:

Step 3. Create an SNMP View using the following syntax:

snmp-server view view-name oid-tree included/excluded

Where:

- view-name — This specifies the name for the view that is being created or updated. This can be 1 to 30 characters.

- oid-tree — This specifies the Abstract Syntax Notation 1 (ASN.1) subtree OID to be included or excluded from the view. ASN.1 is the term used for the definition of data types and values, and how those data types and values are used and combined in various data structures. To identify the subtree, specify a text string consisting of numbers, such as 1.2.1.1.1.0, or a word, such as System and, optionally, a sequence of numbers. Replace a single sub-identifier with the asterisk (*) wildcard to specify a subtree family; for example, 1.3.*.4. This parameter depends on the MIB being specified.

- included — This specifies that the view subtree is included from the MIB view.

- excluded — This specifies that the view subtree is excluded from the MIB view.

Note: In this example, snmp-server view user-view system.7 excluded is entered.

Step 4. Switch to Global Configuration Mode by entering the exit command.

Step 5. (Optional) Execute the following command to save in the startup configuration:

Step 6. (Optional) Press Y to save the settings in the startup configuration of the switch otherwise, press N to proceed without saving the configuration to the startup configuration of the switch.

Step 7. Verify SNMP group using the following command in privileged mode:

You should now have configured an SNMP views settings through the CLI of the switch.