C i s c o C o n f i d e n t i a l - B e t a R e v i e w R 3 . 7. 1
SNMP Server Commands on Cisco IOS XR Software
snmp-server host
SMR-610
Cisco ASR 14000 Series Router System Management Command Reference
OL-17231-01
To enable multiple hosts, issue a separate
snmp-server host
command for each host. You can specify
multiple notification types in the command for each host.
When multiple
snmp-server host
commands are given for the same host and kind of notification (trap),
each succeeding command overwrites the previous command. Only the last
snmp-server host
command
is in effect. For example, if an
snmp-server host
command with the
traps
keyword is entered for a host
and then another
snmp-server host
command with the
traps
keyword is entered for the same host, the
second command replaces the first.
The
snmp-server host
command is used with the
command. Use the
snmp-server traps
command to specify which SNMP notifications are sent globally. For a host to
receive most notifications, at least one
snmp-server traps
command and the
snmp-server host
command for that host must be enabled.
However, some notification types cannot be controlled with the
snmp-server traps
command. For
example, some notification types are always enabled. Other notification types are enabled by a different
command.
The availability of a notification-type depends on the device type and Cisco software features supported
on the device.
To display which notification types are available on the system, use the question mark (
?
) online help
function at the end of the
snmp-server host
command.
The
no snmp-server host
command used with no keywords disables traps.
Use the
clear
keyword to specify that the clear text community string you enter is displayed encrypted
in the
show running
command output. To enter an encrypted string, use the
encrypted
keyword. To
enter a clear text community string that is not encrypted by the system, use neither of these keywords.
Task ID
Examples
The following example shows how to send RFC 1157 SNMP traps to the host specified by the name
myhost.cisco.com. Other traps are enabled, but only SNMP traps are sent because only the
snmp
keyword is specified in the
snmp-server host
command. The community string is defined as comaccess.
RP/0/RP0/CPU0:Router(config)#
snmp-server traps
RP/0/RP0/CPU0:Router(config)#
snmp-server host myhost.cisco.com comaccess snmp
The following example shows how to send the SNMP traps to address 172.30.2.160:
RP/0/RP0/CPU0:Router(config)#
snmp-server traps snmp
RP/0/RP0/CPU0:Router(config)#
snmp-server host 172.30.2.160 public snmp
The following example shows how to enable the router to send all traps to the host myhost.cisco.com
using the community string public:
RP/0/RP0/CPU0:Router(config)#
snmp-server traps
RP/0/RP0/CPU0:Router(config)#
snmp-server host myhost.cisco.com public
The following example shows how to prevent traps from being sent to any host. The BGP traps are
enabled for all hosts, but only the configuration traps are enabled to be sent to a host.
RP/0/RP0/CPU0:Router(config)#
snmp-server traps bgp
RP/0/RP0/CPU0:Router(config)#
snmp-server host hostabc public config
Task ID
Operations
snmp
read, write