SNMP Trap Commands

Use these M4500 CLI commands to configure SNMP trap receivers and enable traps for authentication, links, power, fans, routing protocols, and other events.

snmp-server host <host-addr> traps

This command configures traps to be sent to the specified host.

Default None
Format snmp-server host <host-addr> traps version {1 <community> | 2 <community> | 3 <username> [auth | priv]} [filter <filtername>] [udp-port <1-65535>]
Mode Global Config
Parameter Definition
<host-addr> The IPv4 or IPv6 address of the host to send the trap to.
version 1 Sends SNMPv1 traps.
version 2 Sends SNMPv2 traps.
<community> Community string sent as part of the notification. The range is 1 to 20 characters.
version 3 Sends SNMPv3 traps.
<username> Username of SNMPv3.
auth Enables authentication of a packet without encrypting.
priv Enables authentication and encrypting of a packet.
<filtername> The filter name to associate with this host. Filters can be used to specify which traps are sent to this host. The range is 1 to 30 characters.
udp-port <1-65535> The SNMP trap receiver port. The default is port 162.

no snmp-server host <host-addr>

This command deletes trap receivers.

Format no snmp-server host <host-addr>
Mode Global Config

show trapflags

This command displays trap conditions. Configure which traps the switch should generate by enabling or disabling the trap condition. If a trap condition is enabled and the condition is detected, the switch's SNMP agent sends the trap to all enabled trap receivers. The switch does not have to be reset to implement the changes. Cold and warm start traps are always generated and cannot be disabled.

Default None
Format show trapflags
Mode Privileged Exec

Display Message

Parameter Definition
Authentication Flag May be enabled or disabled. The factory default is enabled. Indicates whether authentication failure traps will be sent.
Link Up/Down Flag May be enabled or disabled. The factory default is enabled. Indicates whether link status traps will be sent.
Multiple Users Flag May be enabled or disabled. The factory default is enabled. Indicates whether a trap will be sent when the same user ID is logged into the switch more than once at the same time (either via telnet or serial port).
Spanning Tree Flag May be enabled or disabled. The factory default is enabled. Indicates whether spanning tree traps will be sent.
ACL Traps May be enabled or disabled. The factory default is disabled. Indicates whether ACL traps will be sent.
BGP Traps May be enabled or disabled. The factory default is disabled. Indicates whether BGP traps will be sent.
OSPFv2 Traps May be enabled or disabled. The factory default is disabled. Indicates whether OSPF traps will be sent.
PIM Traps May be enabled or disabled. The factory default is disabled. Indicates whether PIM traps will be sent.
OSPFv3 Traps May be enabled or disabled. The factory default is disabled. Indicates whether OSPFv3 traps will be sent.
Power Supply Module state trap May be enabled or disabled. The factory default is enabled. Indicates whether power supply status traps will be sent.
Temperature trap May be enabled or disabled. The factory default is enabled. Indicates whether temperature status traps will be sent.
Fan trap May be enabled or disabled. The factory default is enabled. Indicates whether fan status traps will be sent.
FIP snooping Traps May be enabled or disabled. The factory default is enabled. Indicates whether snooping traps will be sent.
Transceiver Traps May be enabled or disabled. The factory default is disabled. Indicates whether Transceiver traps will be sent.

Example: The following shows examples of the CLI display output for the commands.

CODE
(M4500-32C) (Config)#show trapflags
Authentication Flag............................ Enable
Link Up/Down Flag.............................. Enable
Multiple Users Flag............................ Enable
Spanning Tree Flag............................. Enable
ACL Traps...................................... Disable
BGP Traps...................................... Disable
OSPFv2 traps................................... Disable
PIM Traps...................................... Disable
OSPFv3 Traps................................... Disable
Power Supply Module state trap................. Enable
Temperature trap............................... Enable
Fan trap....................................... Enable
FIP snooping Traps............................. Enable
Transceiver Flag............................... Disable

snmp-server enable traps acl-trapflags

This command enables the acl trap.

Default Disabled
Format snmp-server enable traps acl-trapflags
Mode Global Config

no snmp-server enable traps acl-trapflags

This command disables the acl trap.

Format no snmp-server enable traps acl-trapflags
Mode Global Config

snmp-server enable traps authentication

This command enables the Authentication trap.

Default Enabled
Format snmp-server enable traps authentication
Mode Global Config

no snmp-server enable traps authentication

This command enables the Authentication trap.

Format no snmp-server enable traps authentication
Mode Global Config

snmp-server enable traps bgp state-changes limited

This command enables the BGP trap.

Default Disabled
Format snmp-server enable traps bgp state-changes limited
Mode Global Config

no snmp-server enable traps bgp state-changes limited

This command disables the BGP trap.

Format no snmp-server enable traps bgp state-changes limited
Mode Global Config

snmp-server enable traps fan

This command enables the fan status trap.

Default Enabled
Format snmp-server enable traps fan
Mode Global Config

no snmp-server enable traps fan

This command disables the fan status trap.

Format no snmp-server enable traps fan
Mode Global Config

snmp-server enable traps linkmode

This command enables Link Up/Down traps for the entire switch. When enabled, link traps are sent only if the Link Trap flag setting associated with the port is enabled (see ‘snmp trap link-status’ command).

Default Enabled
Format snmp-server enable traps linkmode
Mode Global Config

no snmp-server enable traps linkmode

This command disables Link Up/Down traps for the entire switch.

Format no snmp-server enable traps linkmode
Mode Global Config

snmp-server enable traps multiusers

This command enables Multiple User traps. When the traps are enabled, a Multiple User Trap is sent when a user logs in to the terminal interface (EIA 232 or telnet) and there is an existing terminal interface session.

Default Enabled
Format snmp-server enable traps multiusers
Mode Global Config

no snmp-server enable traps multiusers

This command disables Multiple User trap.

Format no snmp-server enable traps multiusers
Mode Global Config

snmp-server enable traps ospf

This command enables OSPF traps.

Default Disabled
Format snmp-server enable traps ospf {all | errors {all | authentication-failure | bad-packet | config-error | virt-authentication-failure | virt-bad-packet | virt-config-error} | lsa {all | lsa-maxage | lsa-originate} | overflow {all | lsdb-overflow | lsdb-approaching-overflow} | retransmit {all | packets | virt-packets} | state-change {all | if-state-change | neighbor-state-change | virtif-state-change | virtneighbor-state-change}}
Mode Global Config

no snmp-server enable traps ospf

This command disables OSPF trap.

Format no snmp-server enable traps ospf {all | errors {all | authentication-failure | bad-packet | config-error | virt-authentication-failure | virt-bad-packet | virt-config-error} | lsa {all | lsa-maxage | lsa-originate} | overflow {all | lsdb-overflow | lsdb-approaching-overflow} | retransmit {all | packets | virt-packets} | state-change {all | if-state-change | neighbor-state-change | virtif-state-change | virtneighbor-state-change}}
Mode Global Config

snmp-server enable traps ospfv3

This command enables OSPFv3 traps.

Default Disabled
Format snmp-server enable traps ospfv3 {all | errors {all | bad-packet | config-error | virt-bad-packet | virt-config-error} | lsa {all | lsa-maxage | lsa-originate} | overflow {all | lsdb-overflow | lsdb-approaching-overflow} | retransmit {all | packets | virt-packets} | state-change {all | if-state-change | neighbor-state-change | virtif-state-change | virtneighbor-state-change}}
Mode Global Config

no snmp-server enable traps ospfv3

This command disables OSPFv3 trap.

Format no snmp-server enable traps ospfv3 {all | errors {all | bad-packet | config-error | virt-bad-packet | virt-config-error} | lsa {all | lsa-maxage | lsa-originate} | overflow {all | lsdb-overflow | lsdb-

approaching-overflow} | retransmit {all | packets | virt-packets} | state-change {all | if-state-change | neighbor-state-change | virtif-state-change | virtneighbor-state-change}}

Mode Global Config

snmp-server enable traps pim

This command enables PIM traps.

Default Disabled
Format snmp-server enable traps pim
Mode Global Config

no snmp-server enable traps pim

This command disables PIM trap.

Format no snmp-server enable traps pim
Mode Global Config

snmp-server enable traps powersupply

This command enables power supply status traps.

Default Enabled
Format snmp-server enable traps powersupply
Mode Global Config

no snmp-server enable traps powersupply

This command disables power supply status trap.

Format no snmp-server enable traps powersupply
Mode Global Config

snmp-server enable traps stpmode

This command enables the sending of new root traps and topology change notification traps.

Default Enabled
Format snmp-server enable traps stpmode
Mode Global Config

no snmp-server enable traps stpmode

This command disables the sending of new root traps and topology change notification traps.

Format no snmp-server enable traps stpmode
Mode Global Config

snmp-server enable traps temperature

This command enables the temperature status trap.

Default Enabled
Format snmp-server enable traps temperature
Mode Global Config

no snmp-server enable traps temperature

This command disables the temperature status trap.

Format no snmp-server enable traps temperature
Mode Global Config

snmp-server enable traps transceiver

This command enables the transceiver trap.

Default Disabled
Format snmp-server enable traps transceiver
Mode Global Config

no snmp-server enable traps transceiver

This command disables the transceiver trap.

Format no snmp-server enable traps transceiver
Mode Global Config

snmp-server enable traps violation

This command enables the violation trap.

Default Disabled
Format snmp-server enable traps violation
Mode Global Config

Interface Config

no snmp-server enable traps violation

This command disables the violation trap.

Format no snmp-server enable traps violation
Mode Global Config

Interface Config

show snmp source-interface

This command displays the configured global source interface used for the SNMP client. The IP address of the selected interface is used as source IP for all communications with the server.

Default None
Format show snmp source-interface
Mode Privileged Exec

Display Message

Parameter Definition
SNMP trap Client Source Interface The interface configured as the source interface for the SNMP trap/inform client.
SNMP trap Client IPv4 Address The IP address configured on the SNMP client source interface.

Example: The following shows examples of the CLI display output for the commands.

CODE
(M4500-32C) (Config)#show snmp source-interface

SNMP trap Client Source Interface.............. serviceport
SNMP trap Client Source IPv4 Address........... 172.16.3.60                [Up]
SNMP trap Client Source IPv6 Address........... fe80::2e60:cff:fe83:ad47   [Up]

snmptrap source-interface

Use this command in Global configuration mode to configure the global source-interface (Source IP address) for all SNMP communications between the SNMP client and the server. This command takes effect for both SNMP trap and inform client.

Default Disabled
Format snmptrap source-interface {<slot/port> | loopback <loopback-id> | serviceport | tunnel <tunnel-id> | vlan <vlan-id>}
Mode Global Config
Parameter Definition
<slot/port> Specifies the interface to use as the source interface.
<loopback-id> Specifies the loopback interface to use as the source interface. The range of the loopback ID is 0 to 63.
<tunnel-id> Specifies the tunnel interface to use as the source interface. The range of the tunnel ID is 0 to 7.
<vlan-id> Specifies the VLAN interface to use as the source interface. The range of VLAN ID is 1 to 4093.

no snmptrap source-interface

This command removes the global source-interface for all SNMP communication between the SNMP client and the server.

Format no snmptrap source-interface
Mode Global Config