snmp-server host

Syntax

snmp-server hosttrap version[community] [port] [没有snmp-server主机trap version[community] [port ] [] snmp-server hostinform version v2c [community] [port] [没有snmp-server主机inform version v2c [community] [port] [] snmp-server host[trap version v3 | inform version v3] user[port] [没有snmp-server主机[trap version v3 | inform version v3] user[port] []

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.

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.

Specifies the IP address of a trap receiver in IPv6 format (x:x::x:x).

trap version

Specifies the trap notification type for SNMPv1, v2c or v3. Available options are:v1,v2corv3.

inform version v2c

Specifies the inform notification type for 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.

Specifies the VRF on which the SNMP agent listens for incoming requests.

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)#没有snmp-server主机10.10.10.10 trap version v1switch(config)#snmp-server host a:b::c:d trap version v1switch(config)#no snmp-server host a:b::c:d trap version v1switch(config)#snmp-server host 10.10.10.10 trap version v2c community publicswitch(config)#没有snmp-server主机10.10.10.10 trap version v2c community publicswitch(config)#snmp-server host a:b::c:d trap version v2c community publicswitch(config)#no snmp-server host a:b::c:d trap version v2c community publicswitch(config)#snmp-server host 10.10.10.10 trap version v2c community public port 5000switch(config)#没有snmp-server主机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)#没有snmp-server主机10.10.10.10 trap version v2c community public port 5000 vrf defaultswitch(config)#snmp-server host a:b::c:d trap version v2c community public port 5000switch(config)#no snmp-server host a:b::c:d trap version v2c community public port 5000switch(config)#snmp-server host 10.10.10.10 inform version v2c community publicswitch(config)#没有snmp-server主机10.10.10.10 inform version v2c community publicswitch(config)#snmp-server host a:b::c:d inform version v2c community publicswitch(config)#no snmp-server host a:b::c:d inform version v2c community publicswitch(config)#snmp-server host 10.10.10.10 inform version v2c community public port 5000switch(config)#没有snmp-server主机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)#没有snmp-server主机10.10.10.10 inform version v2c community public port 5000 vrf defaultswitch(config)#snmp-server host a:b::c:d inform version v2c community public port 5000switch(config)#no snmp-server host a:b::c:d inform version v2c community public port 5000switch(config)#snmp-server host 10.10.10.10 trap version v3 user Adminswitch(config)#没有snmp-server主机10.10.10.10 trap version v3 user Adminswitch(config)#snmp-server host a:b::c:d trap version v3 user Adminswitch(config)#no snmp-server host a:b::c:d trap version v3 user Adminswitch(config)#snmp-server host 10.10.10.10 trap version v3 user Admin port 2000switch(config)#没有snmp-server主机10.10.10.10 trap version v3 user Admin port 2000switch(config)#snmp-server host a:b::c:d trap version v3 user Admin port 2000switch(config)#no snmp-server host a:b::c:d trap version v3 user Admin port 2000