2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-21 16:39:32 +00:00

Decode Linux kernel panic SEL records

The Linux kernel ipmi panic logger stores panic strings in SEL records
of type 0xf0, with a chunk sequence number in byte 4 and up to 11
characters of the message in bytes 5-15.  ipmitool and freeipmi both
recognize this convention; do the same rather than presenting such
records as opaque non-timestamped OEM data.
This commit is contained in:
Markus Hilger
2026-07-10 15:48:05 +02:00
parent 9f35965b1b
commit 2034d522d7
+12
View File
@@ -541,6 +541,18 @@ class EventHandler(object):
elif 0xc0 <= selentry[2] <= 0xdf:
event['oemid'] = selentry[7:10]
event['oemdata'] = selentry[10:]
elif selentry[2] == 0xf0:
# De facto standard from the Linux kernel ipmi panic logger,
# also recognized by ipmitool and freeipmi: byte 4 is a chunk
# sequence number and bytes 5-15 carry a piece of the panic
# string
event['event'] = 'Linux kernel panic: {0}'.format(
selentry[5:16].partition(b'\x00')[0].decode(
'utf-8', 'replace'))
event['severity'] = pygconst.Health.Critical
# this layout is defined by the kernel convention rather than
# the BMC vendor, so bypass the OEM handler
return event
elif selentry[2] >= 0xe0:
# In this class of OEM message, all bytes are OEM, interpretation
# is wholly left up to the OEM layer, using the OEM ID of the BMC