From ae6e8133a52f8b91d553f24fb32bb6fc4a21dd41 Mon Sep 17 00:00:00 2001 From: "Thang Q. Nguyen" Date: Wed, 1 Sep 2021 05:09:19 +0000 Subject: meta-ampere: rsyslog: support IPMI SEL Enable rsyslog to save IPMI SEL event into /var/log/ipmi_sel. Tested: 1. Log IPMI SEL event using xyz.openbmc_project.Logging.IPMI 2. Check /var/log/ipmi_sel for the new entry root@mtjade:~# cat /var/log/ipmi_sel 2021-09-01T09:23:49.022943+00:00 1,c0,3ACD000FEB00000000000000,,, Signed-off-by: Thang Q. Nguyen Change-Id: Ic02a6166498251ed1e84a56e4847f465a069c872 --- .../recipes-extended/rsyslog/rsyslog/rsyslog.conf | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'meta-ampere') diff --git a/meta-ampere/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf b/meta-ampere/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf index 656f1d3fb..121833f36 100644 --- a/meta-ampere/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf +++ b/meta-ampere/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf @@ -12,7 +12,26 @@ # journal workaround to avoid duplicate entries module(load="imjournal" StateFile="/var/log/state" RateLimit.Interval="60" - RateLimit.Burst="2000") + RateLimit.Burst="4000") + +# Template for IPMI SEL messages +# " ,,,[,,]" +template(name="IPMISELTemplate" type="list") { + property(name="timereported" dateFormat="rfc3339") + constant(value=" ") + property(name="$!IPMI_SEL_RECORD_ID") + constant(value=",") + property(name="$!IPMI_SEL_RECORD_TYPE") + constant(value=",") + property(name="$!IPMI_SEL_DATA") + constant(value=",") + property(name="$!IPMI_SEL_GENERATOR_ID") + constant(value=",") + property(name="$!IPMI_SEL_SENSOR_PATH") + constant(value=",") + property(name="$!IPMI_SEL_EVENT_DIR") + constant(value="\n") +} # Template for Redfish messages # " ," @@ -37,6 +56,13 @@ template(name="CrashTemplate" type="list") { } +# If the journal entry has the IPMI SEL MESSAGE_ID, save as IPMI SEL +# The MESSAGE_ID string is generated using journalctl and must match the +# MESSAGE_ID used in IPMI to correctly find the SEL entries. +if ($!MESSAGE_ID == "b370836ccf2f4850ac5bee185b77893a") then { + action(type="omfile" file="/var/log/ipmi_sel" template="IPMISELTemplate") +} + # If the journal entry has a Redfish MessageId, save as a Redfish event if ($!REDFISH_MESSAGE_ID != "") then { action(type="omfile" file="/var/log/redfish" template="RedfishTemplate") -- cgit v1.2.3