snmp-server host

Configures the agent with the SNMP trap destination information with the community or user-name attached to it.

Syntax

snmp-server { host [ ip-address | host ] comm-user udp-port version [ 1 | 2c | 3 ] }
no snmp-server { host [ ip-address | host ] comm-user }

Parameters

ip-address
Specifies the trap receiver unicast IPv4 or IPv6 address.
host
Specifies the host name of the trap receiver.
comm-user
Specifies the community string associated with SNMP traps. Community string must start with a character and can contain only alpha-numeric characters. The valid string length is 2 through 16 characters.
Supported on SNMP versions 1 and 2c.
udp-port
Specifies the port on which the receiver is listening for SNMP traps. Valid port range is 1 through 65535.
The default port is 162.
version [ 1 | 2c | 3 ]
Specifies the SNMP version to be used to send SNMP traps. Default version is 2c.
If SNMP version is 3, the valid length is between 1 and 32 characters.

Modes

Config mode

Usage Guidelines

This command is available only to users with the admin role.

This command combines a host and community string.

Only valid unicast IP addresses are supported. Multicast IP addresses are not supported.

The no form of the command removes the corresponding configuration.

Examples

The following example configures the SNMP server with the community string using version 2c.

device# configure terminal
device(config)# snmp-server host 10.23.17.128 public 162 version 2c 

device(config)# do show running-config snmp-server 
snmp-server host 10.23.17.128 public 162 version 2c 

The following example removes the configured host and community string.

device# configure terminal
device(config)# no snmp-server host 10.23.17.128 public