-
Key Topics
- The Simple Network Management Protocol (SNMP) enables a network device to share information about itself and its activities.
-
A complete SNMP system consists of the following parts:
-
SNMP manager:
- A network management system that uses SNMP to poll and receive data from any number of network devices. The SNMP manager usually is an application that runs in a central location.
-
SNMP agent:
- A process that runs on the network device being monitored. All types of data are gathered by the device itself and stored in a local database. The agent can then respond to SNMP polls and queries with information from the database, and it can send unsolicited alerts or "traps" to an SNMP manager.
-
Management Information Base
- A collection of information and data that a network device maintains about itself and its operation. MIB variables can be read or written through SNMP.
-
Object Identifier
- A unique string of digits that identifies a variable or a tree of variables in a MIB.
-
Configuration
-
SNMPv1 & SNMPv2c
-
Configure RO and RW communities:
-
Enable the SNMP agent (if not already started), set the read-only community string, and restrict incoming SNMP messages based on the optional referenced IPv4 or IPv6 ACL.
- snmp-server community <community_string> ro [ipv6 acl_name] [acl_name]
-
(Optional) Enable the SNMP agent (if not already started), set the read-write community string, and restrict incoming SNMP messages based on the optional referenced IPv4 or IPv6 ACL.
- snmp-server community <community_string> rw [ipv6 acl_name] [acl_name]
- (Optional) If referenced by an snmp-server community command, configure an IPv4 or IPv6 ACL
-
(Optional) Document the location of the device.
- snmp-server location <text>
-
(Optional) Document the person to contact if problems occur
- snmp-server contact <contact-name>
-
Enable the sending of SNMPv2c Trap or Inform messages to an NMS:
-
Configure the SNMP agent to send either SNMPv2c Traps (default) or Informs to the listed host. Use this command once for each host to which this device should send Traps.
- snmp-server host {<hostname> | <ip_address>} [informs] version 2c <notification_community>
-
Enable the sending of all supported types of Trap and Inform messages.
- snmp-server enable traps
-
SNMPv3
-
Configure an SNMPv3 Group
- snmp-server group
-
The command takes the following form:
- R1(config)# snmp-server group <GroupName> v3 {noauth | auth | priv } write {view_name} access [ipv6] acl_name
-
Configure one or more SNMPv3 Users that reference the SNMPv3 Group
- snmp-server user
-
The command takes the following form:
- R1(config)# snmp-server user <UserName> <GroupName> v3
-
Parameters in this command must match parameters in the snmp-server group command. Specifically:
- If the auth command keyword was chosen
- You must set either
- auth md5 <password>
- auth sha <password>
- If the priv command keyword was chosen
- You must set either
- auth md5 <password>
- auth md5 <password>
- And either
- priv des <keyvalue>
- priv 3des <keyvalue>
- priv aes <keylength> <keyvalue>
-
In SNMP, the NMS is considered the client (host), and the managed devices are SNMP servers. Configure an SNMP host to receive SNMP GET messages from, and send SNMP Trap messages to.
- snmp-server host
-
The command takes the following form:
- R1(config)# snmp-server host <address> version 3 {noauth | auth | priv } <UserName>
-
Parameters in this command must match parameters in the snmp-server group and snmp-server user commands. Specifically:
- Whichever security level command keyword was chosen in the snmp-server group command must be matched in this command.
- If you issued the noauth command keyword in the snmp-server group command, you must also issue it here.
- If you issued the auth command keyword in the snmp-server group command, you must also issue it here.
- If you issued the priv command keyword in the snmp-server group command, you must also issue it here.
- The <UserName> from the snmp-server user command must match between that command and the snmp-server host command.
-
Verifying and Troubleshooting
-
Lists the community string values, with reference to any attached IPv4 or IPv6 ACLs
- show snmp community
-
Lists the IP address or hostname of the NMS matched to each configured snmp-server host command
- show snmp host
-
Lists information provided by the snmp-server contact command
- show snmp contact
-
Lists information provided by the snmp-server location command
- show snmp location
-
Lists SNMP counter and status information
- show snmp
-
Lists SNMPv3 user information
- show snmp user
-
Lists SNMPv3 group information
- show snmp group