snmp-server host
Syntax
snmp-server host <IPv4-ADDR> trap version <VERSION> [community <STRING>]
[port <UDP-PORT>] [vrf <VRF-NAME>]
no snmp-server host <IPv4-ADDR> trap version <VERSION> [community <STRING>]
[port <UDP-PORT>] [vrf <VRF-NAME>]
snmp-server host <IPv4-ADDR> inform version v2c [community <STRING>]
[port <UDP-PORT>] [vrf <VRF-NAME>]
no snmp-server host <IPv4-ADDR> inform version v2c [community <STRING>]
[port <UDP-PORT>] [vrf <VRF-NAME>]
snmp-server host <IPv4-ADDR> [trap version v3 | inform version v3] user <NAME>
[port <UDP-PORT>] [vrf <VRF-NAME>]
no snmp-server host <IPv4-ADDR> [trap version v3 | inform version v3] user <NAME>
[port <UDP-PORT>] [vrf <VRF-NAME>]
Description
Configures a trap/informs receiver to which the SNMP agent can send SNMP v1/v2c/v3 traps or v2c informs. A maximum of 30 SNMP traps/informs receivers can be configured.
The
no
form of this command removes the specified trap/inform receiver.
snmpv3 informs
is not supported.
Command context
config
Parameters
<IPv4-ADDR>
Specifies the IP address of a trap receiver in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255. You can remove leading zeros. For example, the address192.169.005.100
becomes192.168.5.100
.trap version <VERSION>
Specifies the trap notification type for SNMPv1 or v2c. Available options are:
v1
orv2c
.inform version v2c
Specifies the inform notification type for SNMPv2c.
trap version v3
Specifies the trap notification type for SNMPv3.
user <NAME>
Specifies the SNMPv3 user name to be used in the SNMP trap notifications.
community <STRING>
Specifies the name of the community string to use when sending trap notifications. Range: 1 - 32 printable ASCII characters, excluding space and question mark. Default:
public
.<UDP-PORT>
Specifies the UDP port on which notifications are sent. Range: 1 - 65535. Default: 162.
vrf <VRF-NAME>
Specifies the name of the VRF on which to send the notifications.
Authority
Administrators
Examples
switch(config)# snmp-server host 10.10.10.10 trap version v1 switch(config)# no snmp-server host 10.10.10.10 trap version v1 switch(config)# snmp-server host 10.10.10.10 trap version v2c community public switch(config)# no snmp-server host 10.10.10.10 trap version v2c community public switch(config)# snmp-server host 10.10.10.10 trap version v2c community public port 5000 switch(config)# no snmp-server host 10.10.10.10 trap version v2c community public port 5000 switch(config)# snmp-server host 10.10.10.10 trap version v2c community public port 5000 vrf default switch(config)# no snmp-server host 10.10.10.10 trap version v2c community public port 5000 vrf default switch(config)# snmp-server host 10.10.10.10 inform version v2c community public switch(config)# no snmp-server host 10.10.10.10 inform version v2c community public switch(config)# snmp-server host 10.10.10.10 inform version v2c community public port 5000 switch(config)# no snmp-server host 10.10.10.10 inform version v2c community public port 5000 switch(config)# snmp-server host 10.10.10.10 inform version v2c community public port 5000 vrf default switch(config)# no snmp-server host 10.10.10.10 inform version v2c community public port 5000 vrf default switch(config)# snmp-server host 10.10.10.10 trap version v3 user Admin switch(config)# no snmp-server host 10.10.10.10 trap version v3 user Admin switch(config)# snmp-server host 10.10.10.10 trap version v3 user Admin port 2000 switch(config)# no snmp-server host 10.10.10.10 trap version v3 user Admin port 2000