Dying Gasp for Loss of Power via SNMP

A dying gasp event is a message or signal sent by the router to the NMS element to notify that the node is going down.

Dying Gasp event is triggered when one of the following conditions have occurred:

  • Complete power failure

  • Removal of the input power supply cable

Dying gasp event is not triggered in the following scenarios:

  • Administrative reload, in-service software upgrade (ISSU) or normal shutdown

  • Failures like NP freeze, CPU reset or IOFPGA reset

You can configure the host using the dying-gasp configuration command to generate Dying-Gasp packets. The show dying-gasp packets command displays the detailed information about the created packets.

The SNMP server for the SNMP Dying-Gasp message is specified through the snmp-server host configuration command. The syslog server sending the syslog Dying-Gasp message is specified through the logging host hostname-or-ipaddress transport udp. The Ethernet-OAM Dying-Gasp packets are created for interfaces where Ethernet-OAM is enabled.

Dying-Gasp packets can be sent to a maximum number of 5 servers for each notification type.

Prerequisites for Dying Gasp Support

  • Host must be reachable.

  • ARP must be resolved before a dying gasp event is sent.

Restrictions for Dying Gasp Support

  • Only SNMP trap packets are generated in a dying gasp event.

  • Only five SNMP server host/port are notified of SNMP trap.

  • Generation of SNMP trap for host via management in case of a dying gasp event, is not supported.

  • When the node configured with SNMP DG boots up after reboot/powercycle and the SNMP host in unreachable; the SNMP DG will not be triggered. In such cases the only possible way to enable SNMP DG is to remove and add the config back once the SNMP host is reachable. In conclusion, the SNMP host should be reachable when the node boots after reboot/powercycle

Configuring SNMP Agent for Sending Dying Gasp Events

Use the following command to configure SNMP agent host.

Router# configure terminal
Router(config)# snmp-server host x.x.x.x version X community/user [udp-port port number] [dying gasp]
Router(config)# exit

This example shows IPv4 Dying Gasp SNMP host configuration.


Router(config)# vrf giportA
Router(config-vrf)# ipv4 address 5.1.1.1 255.255.255.0
Router(config-vrf)# address-family ipv4 unicast

Router(config-vrf)# end

Router(config)# arp vrf giportA 5.1.1.2 aabb.ccdd.ef15 arPA
Router(config)# snmp-server vrf giportA host 5.1.1.2 traps version 2c public udp-port 6666 dying-gasp
Router(config)# snmp-server host 5.1.1.2 traps version 2c public udp-port 6666 dying-gasp

Router(config)#commit

Router(config)# interface TenGigE0/0/0/18
Router(config-if)# vrf giportA
Router(config-vrf)# ipv4 address 5.1.1.1 255.255.255.0

Router(config)#commit

Verifying Dying Gasp Host Configuration

Use the show run snmp-server host command to check the configured dying gasp hosts.

Router:#show running-config snmp-server 
Thu Aug  1 10:51:14.156 UTC
snmp-server host 5.1.1.2 traps version 2c public udp-port 6666 dying-gasp
snmp-server host 5.1.1.2 traps version 3 noauth public udp-port 6666 dying-gasp

snmp-server community public
Router# show snmp trace dying-gasp 
Tue Sep  7 19:12:19.850 UTC
 Entering snmp_ltrace main....
16 wrapping entries (128 possible, 64 allocated, 0 filtered, 16 total)
Sep  7 18:57:07.052 snmp/dying-gasp 0/RP0/CPU0 t10413 Dying gasp init Successfull
Sep  7 18:57:07.062 snmp/dying-gasp 0/RP0/CPU0 t10431 dg_snmp_connect_cb:Successfully connected to optic server
Sep  7 18:57:07.232 snmp/dying-gasp 0/RP0/CPU0 t10431 snmp_dying_gasp_handler: Hosts are not yet reachable
Sep  7 18:57:07.312 snmp/dying-gasp 0/RP0/CPU0 t10431 Entered Dying gasp handler 5
Sep  7 19:12:16.019 snmp/dying-gasp 0/RP0/CPU0 t10431 Entered Dying gasp handler 1
Sep  7 19:12:16.019 snmp/dying-gasp 0/RP0/CPU0 t10431 Host added public4$5.1.1.2$1
Sep  7 19:12:16.019 snmp/dying-gasp 0/RP0/CPU0 t10431 make_dying_gasp_trap:Successfully generated trap for index:0 opcode:1 length:101
Sep  7 19:12:16.019 snmp/dying-gasp 0/RP0/CPU0 t10431 Host added public$1400::2$1
Sep  7 19:12:16.019 snmp/dying-gasp 0/RP0/CPU0 t10431 make_dying_gasp_trap:Successfully generated trap for index:1 opcode:1 length:100
Sep  7 19:12:16.043 snmp/dying-gasp 0/RP0/CPU0 t10431 dg_snmp_write_reg_resp_cb:Status received from optic server is 0 for index 0
Sep  7 19:12:16.043 snmp/dying-gasp 0/RP0/CPU0 t10431 dg_snmp_write_reg_resp_cb:Status received from optic server is 0 for index 1