snmp-server enable traps
To enable all Simple Network Management Protocol (SNMP) notification types that are available on your system, use the snmp-server enable traps command in global configuration mode. To disable all available SNMP notifications, use the no form of this command.
snmp-server enable traps [notification-type] [vrrp]
no snmp-server enable traps [notification-type] [vrrp]
Syntax Description
notification-type |
(Optional) Type of notification (trap or inform) to enable or disable. If no type is specified, all notifications available on your device are enabled or disabled (if the no form is used). The notification type can be one of the following keywords: alarms --Enables alarm filtering to limit the number of syslog messages generated. Alarms are generated for the severity configured as well as for the higher severity values.
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
vrrp |
(Optional) Specifies the Virtual Router Redundancy Protocol (VRRP). |
Command Default
No notifications controlled by this command are sent.
Command Modes
Global configuration (config)
Command History
Release |
Modification |
---|---|
10.3 |
This command was introduced. |
12.0(2)T |
The rsvp notification type was added in Cisco IOS Release 12.0(2)T. |
12.0(3)T |
The hsrp notification type was added in Cisco IOS Release 12.0(3)T. |
12.0(24)S |
This command was integrated into Cisco IOS Release 12.0(24)S. |
12.2(14)SX |
Support for this command was implemented on the Supervisor Engine 720. |
12.2(18)S |
This command was integrated into Cisco IOS Release 12.2(18)S. |
12.2(17d)SXB |
Support for this command on the Supervisor Engine 2 was integrated into Cisco IOS Release 12.2(17d)SXB. |
12.3(11)T |
The vrrp notification type was added in Cisco IOS Release 12.3(11)T. |
12.4(4)T |
Support for the alarms notification type and severity argument was added in Cisco IOS Release 12.4(4)T. Support for the dsp and dsp oper-state notification types was added in Cisco IOS Release 12.4(4)T. |
12.2(28)SB |
This command was integrated into Cisco IOS Release 12.2(28)SB. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.4(11)T |
The dot1x notification type was added in Cisco IOS Release 12.4(11)T. |
12.2(33)SRB |
This command was integrated into Cisco IOS Release 12.2(33)SRB. |
12.2SX |
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware. |
12.4(20)T |
The license notification type keyword was added. |
12.2(33)SXH |
The l2tc keyword was added and supported on the Catalyst 6500 series switch. |
12.2(33)SXI |
The following keywords were added and supported on the Catalyst 6500 series switch:
|
Cisco IOS XE Release 2.6 |
This command was integrated into Cisco IOS XE Release 2.6. |
15.0(1)S |
This command was modified. The flowmon notification type was added in Cisco IOS Release 15.0(1)S. |
Cisco IOS XE 3.1.0SG |
This command was modified. Licensing SNMP traps are enabled by default on Catalyst 4500 series switches. |
Cisco IOS XE Release 3.2SE |
This command was implemented in Cisco IOS XE Release 3.2SE. |
Cisco IOS XE Release 3.3SE |
This command was implemented in Cisco IOS XE Release 3.3SE. |
Usage Guidelines
For additional notification types, see the Related Commands table for this command.
SNMP notifications can be sent as traps or inform requests. This command enables both traps and inform requests for the specified notification types. To specify whether the notifications should be sent as traps or informs, use the snmp-server host [traps | informs ] command.
To configure the router to send these SNMP notifications, you must enter at least one snmp-server enable traps command. If you enter the command with no keywords, all notification types are enabled. If you enter the command with a keyword, only the notification type related to that keyword is enabled. To enable multiple types of notifications, you must issue a separate snmp-server enable traps command for each notification type and notification option.
Most notification types are disabled by default but some cannot be controlled with the snmp-server enable traps command.
The snmp-server enable traps command is used in conjunction with the snmp-server host command. Use the snmp-server host command to specify which host or hosts receive SNMP notifications. To send notifications, you must configure at least one snmp-server host command.
Catalyst 6500 Series Switches
The following MIBs were enhanced or supported in Cisco IOS Release 12.2(33)SXI and later releases on the Catalyst 6500 series switch:
-
CISCO-L2-TUNNEL-CONFIG-MIB-LLDP--Enhancement. The CISCO-L2-TUNNEL-CONFIG-MIB provides SNMP access to the Layer 2 tunneling-related configurations.
-
CISCO-PAE-MIB--Enhancement for critical condition and includes traps when the port goes into the Guest Vlan or AuthFail VLAN.
-
CISCO-MODULE-AUTO-SHUTDOWN-MIB--Supported. The CISCO-MODULE-AUTO-SHUTDOWN-MIB provides SNMP access to the Catalyst 6500 series switch Module Automatic Shutdown component.
-
CISCO-AUTH-FRAMEWORK-MIB--Supported. The CISCO-AUTH-FRAMEWORK-MIB provides SNMP access to the Authentication Manager component.
-
CISCO-ENTITY-DIAG-MIB--The CISCO-ENTITY-DIAG-MIB provides SNMP traps for generic online diagnostics (GOLD) notification enhancements.
Examples
The following example shows how to enable the router to send all traps to the host specified by the name myhost.cisco.com, using the community string defined as public:
Router(config)# snmp-server enable traps
Router(config)# snmp-server host myhost.cisco.com public
The following example shows how to configure an alarm severity threshold of 3:
Router# snmp-server enable traps alarms 3
The following example shows how to enable the generation of a DSP operational state notification from from the command-line interface (CLI):
Router(config)# snmp-server enable traps dsp oper-state
The following example shows how to enable the generation of a DSP operational state notification from a network management device:
setany -v2c 1.4.198.75 test cdspEnableOperStateNotification.0 -i 1
cdspEnableOperStateNotification.0=true(1)
The following example shows how to send no traps to any host. The Border Gateway Protocol (BGP) traps are enabled for all hosts, but the only traps enabled to be sent to a host are ISDN traps (which are not enabled in this example).
Router(config)# snmp-server enable traps bgp
Router(config)# snmp-server host user1 public isdn
The following example shows how to enable the router to send all inform requests to the host at the address myhost.cisco.com, using the community string defined as public:
Router(config)# snmp-server enable traps
Router(config)# snmp-server host myhost.cisco.com informs version 2c public
The following example shows how to send HSRP MIB traps to the host myhost.cisco.com using the community string public:
Router(config)# snmp-server enable traps hsrp
Router(config)# snmp-server host myhost.cisco.com traps version 2c public hsrp
The following example shows that VRRP will be used as the protocol to enable the traps:
Router(config)# snmp-server enable traps vrrp
Router(config)# snmp-server host myhost.cisco.com traps version 2c vrrp
The following example shows how to send IEEE 802.1X MIB traps to the host “myhost.example.com” using the community string defined as public:
Router(config)# snmp-server enable traps dot1x
Router(config)# snmp-server host myhost.example.com traps public