snmp-server host

Configures the SNMP trap server host attributes.

Syntax

snmp-server host { ipv4_host | ipv6_host | dns_host } community_string [ version { 1 | 2c } ] [ udp-port port ] [ severity-level | { none | debug | info | warning | error | critical } ] [ use-vrfvrf-name ] [ source-interface { loopback | management { chassis-ip | mgmt-ip } | ve ]
no snmp-server host { ipv4_host | ipv6_host | dns_host } community_string [ version { 1 | 2c } ] [ udp-port port ] [ severity-level | { none | debug | info | warning | error | critical } ] [ use-vrf vrf-name] [ source-interface { loopback | management { chassis-ip | mgmt-ip } | ve ]

Parameters

host { ipv4_host | ipv6_host | dns_host }
Specifies the IP address of the host. IPv4, IPv6, and DNS hosts are supported.
community_string
Specifies the community string associated with the host entry. The number of characters available for the string ranges from 1 through 64.
version { 1 | 2c }
Selects version 1 or 2c traps to be sent to the specified trap host.
udp-port port
Specifies the UDP port where SNMP traps will be received. Valid port IDs range from 0 through 65535. The default port is 162.
severity-level { none | debug | info | warning | error | critical }
Provides the ability to filter traps based on severity level on both the host and the SNMPv3 host. Only RASLog (swEvent) traps can be filtered based on severity level. The configured severity level marks the reporting threshold. All messages with the configured severity or higher are displayed. If the severity level of none is specified, all traps are filtered and no RASLog traps are received.
use-vrf vrf-name

Specifies a VRF though which to communicate with the SNMP host. By default, all management services are enabled on the management VRF ("mgmt-vrf") and the default VRF ("default-vrf").

source-interface { loopback | management { chassis-ip | mgmt-ip } | ve
Specifies whether to use a loopback, management, or VE interface as a source address for notifications. For management, specifies the chassis or management IP address.

Modes

Global configuration mode

Usage Guidelines

This command sets the trap destination IP addresses and SNMP version, associates a community string with a trap host community string (for v1 and v2c), and specifies the UDP destination port where SNMP traps will be received.

To configure SNMP trap hosts associated with community strings, you must create the community string using the snmp-server community command before configuring the host.

The host supports six communities and their associated trap recipients and trap recipient severity levels. The default value for the trap recipient of each community is 0.0.0.0. The length of the community string should be between 2 and 64 characters.

The no snmp-server host host community-stringversion 2c command brings version 2c down to version 1.

The no snmp-server host host community-string command removes the SNMP server host from the device configuration altogether.

The no form of the command can be used to remove the following configuration for a given host: version, udp-port, severity-level, and use-vrf.

Examples

The following example creates an entry for trap host 1050:0:0:0:5:600:300c:326b associated with community “public.” The trap host receives traps from the configured device.

device(config)# snmp-server host 1050:0:0:0:5:600:300c:326b public severity-level Info

The following example creates an entry for trap host brcd.extremenetworks.com associated with community “public.” The trap host receives traps from the configured device.

device(config)# snmp-server host brcd1.extremenetworks.com public severity-level info 

The following example associates “commaccess” as a read-only community and set 10.32.147.6 as a trap recipient with SNMP version 2c on target port 162.

device(config)# snmp-server host 10.32.147.6 commaccess version 2c udp-port 162

The following example creates a trap host (10.23.23.45) associated with the community “public”, which will receive all traps with the severity level of Info.

device(config)# snmp-server host 10.23.23.45 public severity-level info

The following example resets the severity level to None.

device(config)# snmp-server host 10.23.23.45 public severity-level None

The following example specifies a VRF to communicate with the host.

device(config)# snmp-server host 10.24.61.10 public use-vrf myvrf
The following example removes the SNMP host.
device(config)# no snmp-server host 10.24.61.10 public
The following example removes the udp-port configuration and resets the default to 162.
device(config)# no snmp-server host 10.24.61.10 public udp-port