Configure SNMP
Configure SNMP
Configuring SNMP
This chapter describes how to configure SNMP to monitor the ASA, and includes the following sections:
• Information about SNMP, page 76-1
• Licensing Requirements for SNMP, page 76-3
• Prerequisites for SNMP, page 76-3
• Guidelines and Limitations, page 76-4
• Troubleshooting Tips, page 76-8
• Monitoring SNMP, page 76-11
• Configuration Examples for SNMP, page 76-12
• Additional References, page 76-12
• Feature History for SNMP, page 76-14
Note In software versions 7.2(1), 8.0(2), and later, the SNMP information refreshes about every five seconds.
As a result, we recommend that you wait for at least five seconds between consecutive polls.
Security Models
For configuration purposes, the authentication and privacy options are grouped together into security
models. Security models apply to users and groups, and are divided into the following three types:
• NoAuthPriv—No Authentication and No Privacy, which means that no security is applied to
messages.
• AuthNoPriv—Authentication but No Privacy, which means that messages are authenticated.
• AuthPriv—Authentication and Privacy, which means that messages are authenticated and encrypted.
SNMP Groups
An SNMP group is an access control policy to which users can be added. Each SNMP group is
configured with a security model, and is associated with an SNMP view. A user within an SNMP group
should match the security model of the SNMP group. These parameters specify what type of
authentication and privacy a user within an SNMP group uses. Each SNMP group name and security
model pair must be unique.
SNMP Users
SNMP users have a specified username, a group to which the user belongs, authentication password,
encryption password, and authentication and encryption algorithms to use. The authentication algorithm
options are MD5 and SHA. The encryption algorithm options are DES, 3DES, and AES (which is
available in 128, 192, and 256 versions). When you create a user, you must associate it with an SNMP
group. The user then inherits the security model of the group.
SNMP Hosts
An SNMP host is an IP address to which SNMP notifications and traps are sent. To configure SNMP
Version 3 hosts, along with the target IP address, you must configure a username, because traps are only
sent to a configured user. SNMP target IP addresses and target parameter names must be unique on the
ASA. Each SNMP host can have only one username associated with it. To receive SNMP traps, after you
have added the snmp-server host command, make sure that you configure the user credentials on the
NMS to match those configured on the ASA.
Note To determine whether or not you are entitled to use this feature, enter the show version command or
show activation-key command.
Failover Guidelines
• Supported in SNMP Version 3.
• The SNMP client in each ASA shares engine data with its peer. Engine data includes the engineID,
engineBoots, and engineTime objects of the SNMP-FRAMEWORK-MIB.
IPv6 Guidelines
Does not support IPv6.
Additional Guidelines
• Does not support VACM.
• Does not support SNMP Version 3 for the AIP SSM or AIP SSC.
• Does not support SNMP debugging.
• When using NET-SNMP Version 5.4.2.1, only supports the encryption algorithm version of
AES128. Does not support the encryption algorithm versions of AES246 or AES192.
• For SNMP Version 3, configuration must occur in the following order: group, user, host.
• Before a group is deleted, you must ensure that all users associated with that group are deleted.
• Before a user is deleted, you must ensure that no hosts are configured that are associated with that
username.
• If users have been configured to belong to a particular group with a certain security model, and if
the security level of that group is changed, you must do the following in this sequence:
– Remove the users from that group.
– Change the group security level.
– Add users that belong to the new group.
• The creation of custom views to restrict user access to a subset of MIB objects is not supported.
• All requests and traps are available in the default Read/Notify View only.
• SNMP polling will fail if SNMP syslog messages exceed a high rate (approximately 4000 per
second).
• The value returned for ifNumber will be larger than the number of interfaces that you can query
through SNMP, because ifNumber includes hidden internal interfaces that are not viewable.
Configuring SNMP
This section describes how to configure SNMP, and includes the following topics:
• Enabling SNMP, page 76-5
• Compiling Cisco Syslog MIB Files, page 76-7
Enabling SNMP
The SNMP agent that runs on the ASA performs two functions:
• Replies to SNMP requests from NMSs.
• Sends traps (event notifications) to NMSs.
To enable the SNMP agent and identify an NMS that can connect to the SNMP server, perform the
following steps:
Command Purpose
Step 1 snmp-server enable Ensures that the SNMP server on the ASA is enabled. By default, the
SNMP server is enabled.
Example:
hostname(config)# snmp-server
enable
Step 2 snmp-server group group-name v3 Specifies a new SNMP group. When a community string is configured,
[auth | noauth | priv] two additional groups with the name that matches the community string
are autogenerated: one for the Version 1 security model and one for the
Version 2 security model. For more information about security models,
Example: see the “Security Models” section on page 76-2. The auth keyword
hostname(config)# snmp-server enables packet authentication. The noauth keyword indicates no packet
group testgroup1 v3 auth authentication or encryption is being used. The priv keyword enables
packet encryption and authentication. No default values exist for the auth
or priv keywords.
For use only with SNMP Version 3.
Command Purpose
Step 3 snmp-server user username Configures a new user for an SNMP group. The username argument is the
group-name {v3 [encrypted]] [auth name of the user on the host that belongs to the SNMP agent. The
{md5 | sha]} auth-password [priv
[des | 3des | aes]
group-name argument is the name of the group to which the user belongs.
[128 | 192 | 256] priv-password The v3 keyword specifies that the SNMP Version 3 security model should
be used, and enables the use of the encrypted, priv, and the auth
keywords. The encrypted keyword specifies the password in encrypted
format. Encrypted passwords must be in hexadecimal format. The auth
Example: keyword specifies which authentication level (md5 or sha) should be
hostname(config)# snmp-server
user testuser1 testgroup1 v3 auth
used. The priv keyword specifies the encryption level. No default values
md5 testpassword aes 128 for the auth or priv keywords nor default passwords exist. For the
mypassword encryption algorithm, you can specify either des, 3des, or aes. You can
also specify which version of the AES encryption algorithm to use: 128,
hostname(config)# snmp-server 192, or 256. The auth-password specifies the authentication user
user testuser1 public v3
encrypted auth md5
password. The priv-password specifies the encryption user password.
00:11:22:33:44:55:66:77:88:99:AA: Note If you forget a password, you cannot recover it, and must
BB:CC:DD:EE:FF
reconfigure the user. You can specify a plain-text password or a
localized digest. The localized digest must match the
authentication algorithm selected for the user, which can be either
MD5 or SHA. When the user configuration is displayed on the
console or is written to a file (for example, the
startup-configuration file), the localized authentication and
privacy digests are always displayed instead of a plain-text
password (see the second example). The minimum length for a
password is one character; however, we recommend that you use
at least eight characters for security.
Command Purpose
Step 5 snmp-server community Sets the community string.
community-string
For use only with SNMP Version 1 or 2c.
Example:
hostname(config)# snmp-server
community onceuponatime
Step 6 snmp-server [contact | location] Sets the SNMP server location or contact information.
text
Example:
hostname(config)# snmp-server
location building 42
hostname(config)# snmp-server
contact EmployeeA
Step 7 snmp-server enable traps [all | Sends individual traps, sets of traps, or all traps to the NMS. Enables
syslog | snmp [trap] [...] | syslog messages to be sent as traps to the NMS. The default configuration
entity [trap] [...] | ipsec
[trap] [...] | remote-access
has all SNMP core traps enabled, as shown in the example. To disable
[trap]] these traps, use the no snmp-server enable traps snmp command. If you
enter this command and do not specify a trap type, the default is the syslog
trap. By default, the syslog trap is enabled. The default SNMP traps
continue to be enabled along with the syslog trap. To restore the default
Example: enabling of SNMP traps, use the clear configure snmp-server command.
hostname(config)# snmp-server
enable traps snmp authentication
linkup linkdown coldstart
Note You must manually rename any files with the .my extension to the .mib extension, because only
files with the .mib extension appear in the file selection window of CiscoWorks for Windows.
Troubleshooting Tips
To ensure that the SNMP process that receives incoming packets from the NMS is running, enter the
following command:
hostname(config)# show process | grep snmp
To capture syslog messages from SNMP and have them appear on the ASA console, enter the following
commands:
hostname(config)# logging list snmp message 212001-212015
hostname(config)# logging console snmp
To make sure that the SNMP process is sending and receiving packets, enter the following commands:
hostname(config)# clear snmp-server statistics
hostname(config)# show snmp-server statistics
If the NMS cannot request objects successfully or is not handing incoming traps from the ASA correctly,
use a packet capture to isolate the problem by entering the following commands:
hostname (config)# access-list snmp permit udp any eq snmptrap any
hostname (config)# access-list snmp permit udp any any eq snmp
hostname (config)# capture snmp type raw-data access-list snmp interface mgmt
hostname (config)# copy /pcap capture:snmp tftp://192.0.2.5/exampledir/snmp.pcap
If the ASA is not performing as expected, obtain information about network topology and traffic by
doing the following:
• For the NMS configuration:
– Number of timeouts
– Retry count
– Engine ID caching
– Username and password used
• Run the following commands:
– show block
– show interface
– show process
– show cpu
If a fatal error occurs, to help in reproducing the error, send a traceback file and the output of the show
tech-support command to Cisco TAC.
If SNMP traffic is not being allowed through the ASA interfaces, you might also need to permit ICMP
traffic from the remote SNMP server using the icmp permit command.
For the ASA 5580, differences may appear in the physical interface statistics output and the logical
interface statistics output between the show interface command and show traffic command.
Note For a physical interface that has multiple VLAN interfaces associated with it, note that SNMP
counters for ifInOctets and ifOutoctets OIDs match the aggregate traffic counters for that
physical interface.
The examples in Table 76-1 show the differences in SNMP traffic statistics.
Table 76-1 SNMP Traffic Statistics for Physical and VLAN Interfaces
Example 1 Example 2
The following example shows the difference in physical and logical The following example shows output statistics for a
output statistics for the show interface command and the show VLAN-only interface for the show interface command
traffic command. and the show traffic command. The example shows that
hostname#show interface GigabitEthernet3/2 the statistics are close to the output that appears for the
interface GigabitEthernet3/2 show traffic command:
description fullt-mgmt hostname# show interface GigabitEthernet0/0.100
nameif mgmt
interface GigabitEthernet0/0.100
security-level 10
vlan 100
ip address 10.7.14.201 255.255.255.0 nameif inside
management-only
security-level 100
ip address 47.7.1.101 255.255.255.0 standby
hostname#show traffic 47.7.1.102
(Condensed output)
hostname#show traffic
Physical Statistics inside
GigabitEthernet3/2:
received (in 9921.450 secs)
received (in 121.760 secs)
1977 packets 126528 bytes
36 packets 3428 bytes
0 pkts/sec 12 bytes/sec
0 pkts/sec 28 bytes/sec transmitted (in 9921.450 secs)
1978 packets 126556 bytes
Logical Statistics
0 pkts/sec 12 bytes/sec
mgmt:
received (in 117.780 secs)
36 packets 2780 bytes
ifIndex of VLAN inside:
0 pkts/sec 23 bytes/sec IF-MIB::ifDescr.9 = Adaptive Security Appliance
‘inside’ interface
The following examples show the SNMP output statistics for the IF-MIB::ifInOctets.9 = Counter32: 126318
management interface and the physical interface. The ifInOctets
value is close to the physical statistics output that appears in the
show traffic command output, but not to the logical statistics
output.
ifIndex of the mgmt interface:
IF_MIB::ifDescr.6 = Adaptive Security Appliance ‘mgmt’
interface
Monitoring SNMP
To monitor SNMP, enter one of the following commands:
Command Purpose
clear snmp-server statistics Resets all SNMP counters to zero.
show running-config [default] Displays all SNMP server configuration information.
snmp-server
show running-config snmp-server group Displays SNMP group configuration settings.
show running-config snmp-server host Displays configuration settings used by SNMP to control messages and
notifications sent to remote hosts.
show running-config snmp-server user Displays SNMP user-based configuration settings.
show snmp-server engineid Displays the ID of the SNMP engine configured.
show snmp-server group Displays the names of configured SNMP groups.
Note If the community string has already been configured, two extra groups
appear by default in the output. This behavior is normal.
show snmp-server statistics Displays the configured characteristics of the SNMP server.
show snmp-server user Displays the configured characteristics of users.
Examples
hostname(config)# show snmp-server statistics
0 SNMP packets input
0 Bad SNMP version errors
0 Unknown community name
0 Illegal operation for community name supplied
0 Encoding errors
0 Number of requested variables
0 Number of altered variables
0 Get-request PDUs
0 Get-next PDUs
0 Get-bulk PDUs
0 Set-request PDUs (Not supported)
0 SNMP packets output
0 Too big errors (Maximum packet size 512)
0 No such name errors
0 Bad values errors
0 General errors
0 Response PDUs
0 Trap PDUs
Additional References
For additional information related to implementing SNMP, see the following sections:
• RFCs for SNMP Version 3, page 76-12
• MIBs, page 76-13
RFC Title
3410 Introduction and Applicability Statements for Internet Standard Management Framework
3411 An Architecture for Describing SNMP Management Frameworks
3412 Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
3413 Simple Network Management Protocol (SNMP) Applications
3414 User-based Security Model (USM) for Version 3 of the Simple Network Management Protocol (SNMP)
3826 The Advanced Encryption Standard (AES) Cipher Algorithm in the SNMP User-based Security Model
MIBs
For a list of supported MIBs and traps for the ASA by release, see the following URL:
http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
To obtain a list of the supported SNMP MIBs for a specified ASA, enter the following command:
hostname(config)# show snmp-server oidlist
Note Although the oidlist keyword does not appear in the options list for the show snmp-server command
help, it is available.
The following is sample output from the show snmp-server oidlist command:
[0] 1.3.6.1.2.1.1.1. sysDescr
[1] 1.3.6.1.2.1.1.2. sysObjectID
[2] 1.3.6.1.2.1.1.3. sysUpTime
[3] 1.3.6.1.2.1.1.4. sysContact
[4] 1.3.6.1.2.1.1.5. sysName
[5] 1.3.6.1.2.1.1.6. sysLocation
[6] 1.3.6.1.2.1.1.7. sysServices
[7] 1.3.6.1.2.1.2.1. ifNumber
[8] 1.3.6.1.2.1.2.2.1.1. ifIndex
[9] 1.3.6.1.2.1.2.2.1.2. ifDescr
[10] 1.3.6.1.2.1.2.2.1.3. ifType
[11] 1.3.6.1.2.1.2.2.1.4. ifMtu
[12] 1.3.6.1.2.1.2.2.1.5. ifSpeed
[13] 1.3.6.1.2.1.2.2.1.6. ifPhysAddress
[14] 1.3.6.1.2.1.2.2.1.7. ifAdminStatus
[15] 1.3.6.1.2.1.2.2.1.8. ifOperStatus
[16] 1.3.6.1.2.1.2.2.1.9. ifLastChange
[17] 1.3.6.1.2.1.2.2.1.10. ifInOctets
[18] 1.3.6.1.2.1.2.2.1.11. ifInUcastPkts
[19] 1.3.6.1.2.1.2.2.1.12. ifInNUcastPkts
[20] 1.3.6.1.2.1.2.2.1.13. ifInDiscards
[21] 1.3.6.1.2.1.2.2.1.14. ifInErrors
[22] 1.3.6.1.2.1.2.2.1.16. ifOutOctets
[23] 1.3.6.1.2.1.2.2.1.17. ifOutUcastPkts
[24] 1.3.6.1.2.1.2.2.1.18. ifOutNUcastPkts
[25] 1.3.6.1.2.1.2.2.1.19. ifOutDiscards
[26] 1.3.6.1.2.1.2.2.1.20. ifOutErrors
[27] 1.3.6.1.2.1.2.2.1.21. ifOutQLen
[28] 1.3.6.1.2.1.2.2.1.22. ifSpecific
[29] 1.3.6.1.2.1.4.1. ipForwarding
[30] 1.3.6.1.2.1.4.20.1.1. ipAdEntAddr
[31] 1.3.6.1.2.1.4.20.1.2. ipAdEntIfIndex
[32] 1.3.6.1.2.1.4.20.1.3. ipAdEntNetMask
[33] 1.3.6.1.2.1.4.20.1.4. ipAdEntBcastAddr
[34] 1.3.6.1.2.1.4.20.1.5. ipAdEntReasmMaxSize
[35] 1.3.6.1.2.1.11.1. snmpInPkts
[36] 1.3.6.1.2.1.11.2. snmpOutPkts
[37] 1.3.6.1.2.1.11.3. snmpInBadVersions
[38] 1.3.6.1.2.1.11.4. snmpInBadCommunityNames
[39] 1.3.6.1.2.1.11.5. snmpInBadCommunityUses
[40] 1.3.6.1.2.1.11.6. snmpInASNParseErrs
[41] 1.3.6.1.2.1.11.8. snmpInTooBigs
[42] 1.3.6.1.2.1.11.9. snmpInNoSuchNames
[43] 1.3.6.1.2.1.11.10. snmpInBadValues
[44] 1.3.6.1.2.1.11.11. snmpInReadOnlys
[45] 1.3.6.1.2.1.11.12. snmpInGenErrs