snmp-server host
Syntax
snmp-server host trap version [community ] [port ] [vrf ] no snmp-server host trap version [community ] [port ] [vrf ] snmp-server host inform version v2c [community ] [port ] [vrf ] no snmp-server host inform version v2c [community ] [port ] [vrf ] snmp-server host [trap version v3 | inform version v3] user [port ] [vrf ] no snmp-server host [trap version v3 | inform version v3] user [port ] [vrf ]
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.
Thenoform of this command removes the specified trap/inform receiver.
snmpv3 informsis not supported.Command context
config
Parameters
-
-
Specifies the IP address of a trap receiver in IPv4 format (
x.x.x.x), wherexis a decimal number from 0 to 255. You can remove leading zeros. For example, the address192.169.005.100becomes192.168.5.100. -
trap version -
Specifies the trap notification type for SNMPv1 or v2c. Available options are:
v1orv2c. -
inform version v2c -
指定为SNMPv2c通知通知类型.
-
trap version v3 -
Specifies the trap notification type for SNMPv3.
-
user -
Specifies the SNMPv3 user name to be used in the SNMP trap notifications.
-
community -
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. -
-
Specifies the UDP port on which notifications are sent. Range: 1 - 65535. Default: 162.
-
vrf -
Specifies the name of the VRF on which to send the notifications.
Authority
Administrators or local user group members with execution rights for this command.
Examples
switch(config)#snmp-server host 10.10.10.10 trap version v1switch(config)#no snmp-server host 10.10.10.10 trap version v1switch(config)#snmp-server host 10.10.10.10 trap version v2c community publicswitch(config)#no snmp-server host 10.10.10.10 trap version v2c community publicswitch(config)#snmp-server host 10.10.10.10 trap version v2c community public port 5000switch(config)#no snmp-server host 10.10.10.10 trap version v2c community public port 5000switch(config)#snmp-server host 10.10.10.10 trap version v2c community public port 5000 vrf defaultswitch(config)#no snmp-server host 10.10.10.10 trap version v2c community public port 5000 vrf defaultswitch(config)#snmp-server host 10.10.10.10 inform version v2c community publicswitch(config)#no snmp-server host 10.10.10.10 inform version v2c community publicswitch(config)#snmp-server host 10.10.10.10 inform version v2c community public port 5000switch(config)#no snmp-server host 10.10.10.10 inform version v2c community public port 5000switch(config)#snmp-server host 10.10.10.10 inform version v2c community public port 5000 vrf defaultswitch(config)#no snmp-server host 10.10.10.10 inform version v2c community public port 5000 vrf defaultswitch(config)#snmp-server host 10.10.10.10 trap version v3 user Adminswitch(config)#no snmp-server host 10.10.10.10 trap version v3 user Adminswitch(config)#snmp-server host 10.10.10.10 trap version v3 user Admin port 2000switch(config)#no snmp-server host 10.10.10.10 trap version v3 user Admin port 2000