SNMP Trap Overload
Posted: Fri Aug 16, 2019 10:58 am
I had a post earlier that was incredibly helpful for me in understanding SNMP Traps and their handling, and my question here relates to it. Here is the link: https://support.nagios.com/forum/viewto ... 16&t=54639
For background, I'm working with an APC PDU to send out traps based on the settings on the device. The idea is to send notifications where a phase of power draws more than X amps, or the PDU draws more than Y kilowatts. It's also capable of banks of outlets as well as individual outlets that could also be in an overload condition.
I had originally thought that there would be separate traps for several different types of alarms, but they're all being sent with more generic trap definitions. From the Powernet428 MIB these are the trap names:
rpduInformationalCondition
rpduInformationalConditionCleared
rpduWarningCondition
rpduWarningConditionCleared
rpduCriticalCondition
rpduCriticalConditionCleared
Here is one of the definitions, they are all effectively the same except for the SEVERITY passed and the OID of the trap:
The value in the sixth variable passed back is what differentiates the particular event as a phase number and Amp draw or a phase number and Volts draw or an overall PDU power consumption. Here is an example of what is logged in snmptt.log. I sanitized the IP address and hostname info returned:
Is it possible for me to parse the trap and have it apply to different passive checks using the NagiosXI interface? I understand how to manage the different OIDs for the different severity states. I am using the Enterprise edition. I have a feeling that I'm going to be out of luck or will have to create a lot of custom code and am prepared to restrict this alert to only the most important one.
For background, I'm working with an APC PDU to send out traps based on the settings on the device. The idea is to send notifications where a phase of power draws more than X amps, or the PDU draws more than Y kilowatts. It's also capable of banks of outlets as well as individual outlets that could also be in an overload condition.
I had originally thought that there would be separate traps for several different types of alarms, but they're all being sent with more generic trap definitions. From the Powernet428 MIB these are the trap names:
rpduInformationalCondition
rpduInformationalConditionCleared
rpduWarningCondition
rpduWarningConditionCleared
rpduCriticalCondition
rpduCriticalConditionCleared
Here is one of the definitions, they are all effectively the same except for the SEVERITY passed and the OID of the trap:
Code: Select all
rpduInformationalCondition TRAP-TYPE
ENTERPRISE apc
VARIABLES { mtrapargsString02, mtrapargsString03, mtrapargsInteger, mtrapargsInteger02, mtrapargsInteger03, mtrapargsString }
DESCRIPTION
"INFORMATIONAL: A RPDU informational condition has been detected.
The first variable is the serial number.
The second variable is the device name.
The third variable is the error number.
The fourth variable is the device number.
The fifth variable is the instance number.
The sixth variable is the trap text message."
--#TYPE "RPDU: Informational condition detected."
--#SUMMARY "An informational condition has been detected."
--#SEVERITY INFORMATIONAL
--#TIMEINDEX 1
--#HELP ""
--#HELPTAG 0
--#STATE OPERATIONAL
::= 754Code: Select all
Fri Aug 16 10:11:04 2019 .1.3.6.1.4.1.318.0.752 WARNING "Status Events" IP_ADDRESS - Received trap "rpduWarningCondition" with variables "enterprises.318.2.3.10.0:SERIAL_NUMBER enterprises.318.2.3.11.0:PDU_NAME enterprises.318.2.3.1.0:873595137 enterprises.318.2.3.6.0:1 enterprises.318.2.3.7.0:1 enterprises.318.2.3.3.0:Rack PDU 1: Device near overload."
Fri Aug 16 10:11:19 2019 .1.3.6.1.4.1.318.0.752 WARNING "Status Events" IP_ADDRESS - Received trap "rpduWarningCondition" with variables "enterprises.318.2.3.10.0:SERIAL_NUMBER enterprises.318.2.3.11.0:PDU_NAME enterprises.318.2.3.1.0:874381569 enterprises.318.2.3.6.0:1 enterprises.318.2.3.7.0:1 enterprises.318.2.3.3.0:Rack PDU 1: Bank near overload on bank #1."
Fri Aug 16 10:11:36 2019 .1.3.6.1.4.1.318.0.752 WARNING "Status Events" IP_ADDRESS - Received trap "rpduWarningCondition" with variables "enterprises.318.2.3.10.0:SERIAL_NUMBER enterprises.318.2.3.11.0:PDU_NAME enterprises.318.2.3.1.0:873988353 enterprises.318.2.3.6.0:1 enterprises.318.2.3.7.0:1 enterprises.318.2.3.3.0:Rack PDU 1: Phase near overload on phase #1."
Fri Aug 16 10:11:38 2019 .1.3.6.1.4.1.318.0.752 WARNING "Status Events" IP_ADDRESS - Received trap "rpduWarningCondition" with variables "enterprises.318.2.3.10.0:SERIAL_NUMBER enterprises.318.2.3.11.0:PDU_NAME enterprises.318.2.3.1.0:873988354 enterprises.318.2.3.6.0:1 enterprises.318.2.3.7.0:2 enterprises.318.2.3.3.0:Rack PDU 1: Phase near overload on phase #2."