setenv SR_TRAP_TEST_PORT=UDP port
setenv SR_UTIL_COMMUNITY=public
setenv SR_UTIL_SNMP_VERSION=v2c
setenv SR_MGR_CONF_DIR=Path to the executable snmpinfo.DAT file
The following example shows SNMP trap configuration on three hosts:
Configuration example for the first host:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)# snmp-server host 7.0.0.149 vrf vrf1 version 2c public udp-port 6264
Configuration example for the second host:
Router(config)#
Router(config)# snmp-server host 7.0.0.152 vrf vrf1 version 2c public udp-port 9988
Configuration example for the third host:
Router(config)# snmp-server host 7.0.0.166 vrf vrf1 version 2c public udp-port 9800
Router(config)#
Router(config)# ^Z
Router#
After performing a power cycle, the following output is displayed on the router console:
Router#
Press ESCAPE for boot options
NVRAM: OK
FPGA SPI Flash: OK
FPGA: OK
Rom image verified correctly
System Bootstrap, Version 1.6(20191125:124452) [ncs520-dev], RELEASE SOFTWARE
Compiled at 2019-11-25 12:44 by regvr
Current image running: Boot ROM1
Last reset cause: RSP-Board
rommon 1 >
=======================================
Dying Gasp Trap Received for the Power failure event:
-----------------------------------------------------
Trap on Host1
++++++++++++++
snmp-server host = 7.0.0.149 (nms1-lnx) and SR_TRAP_TEST_PORT=6264
/auto/sw/packages/snmpr/15.4.1.9/bin> /auto/sw/packages/snmpr/15.4.1.9/bin/traprcv
Waiting for traps.
Received SNMPv2c Trap:
Community: public
From: 7.29.25.101
snmpTrapOID.0 = ciscoMgmt.305.1.3.5.0.2
ciscoMgmt.305.1.3.6 = Dying Gasp - Shutdown due to power loss
--------------------------------------------------------------------
Trap on Host2
+++++++++++++
snmp-server host = 7.0.0.152 (nms2-lnx) and SR_TRAP_TEST_PORT=9988
/auto/sw/packages/snmpr/15.4.1.9/bin> /auto/sw/packages/snmpr/15.4.1.9/bin/traprcv
Waiting for traps.
Received SNMPv2c Trap:
Community: public
From: 7.29.25.101
snmpTrapOID.0 = ciscoMgmt.305.1.3.5.0.2
ciscoMgmt.305.1.3.6 = Dying Gasp - Shutdown due to power loss
--------------------------------------------------------------
Trap on Host3
++++++++++++++
snmp-server host = 7.0.0.166 (erbusnmp-dc-lnx) and SR_TRAP_TEST_PORT=9800
/auto/sw/packages/snmpr/15.4.1.9/bin> /auto/sw/packages/snmpr/15.4.1.9/bin/traprcv
Waiting for traps.
Received SNMPv2c Trap:
Community: public
From: 7.29.25.101
snmpTrapOID.0 = ciscoMgmt.305.1.3.5.0.2
ciscoMgmt.305.1.3.6 = Dying Gasp - Shutdown due to power loss