commit | 9f476e82f72e78d2be6cdeb95f7d5552c19d97a7 | [log] [tgz] |
---|---|---|
author | Charles Boyer <Charles.Boyer@fii-usa.com> | Thu Jul 29 16:33:01 2021 -0500 |
committer | Mohaimen Alsamarai <mohaimen.alsamarai@fii-na.com> | Mon Aug 16 14:00:40 2021 +0000 |
tree | 7d2dba0a73c4fdcd719ed9bd273d357c18b50c47 | |
parent | f0243dc62fc4979d46e42276cd98fb41d2c3e2a1 [diff] |
Add Clear method There was an issue where the first SEL records share Record ID 1 if they are generated around the same time. The cause was determined to be that several records get assigned Record ID 1 because the /var/log/ipmi_sel was checked and missing. The file was removed by the IPMI handlers that use this file to store the SEL. This does not apply to IPMI handlers that use phosphor-logging to store SEL entries. Although, a future iteration could add support for removing SEL entries in phosphor-logging. This change adds a method to clear the IPMI SEL that removes the /var/log/ipmi_sel and refreshes rsyslog. The IPMI handlers that use this file would no longer be responsible for directly clearing SEL. Now that phosphor-sel-logger can handle the clear of SEL, the logic for Record ID is simplified. The Clear method is put behind an optional flag for systems experiencing the issue with Record ID 1 and use ipmi_sel. This implementation is alternative to the efforts in https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-sel-logger/+/44533 making it obsolete. Note: - https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces /+/45402 is required. - Do not use send-to-logger option with clears-sel Tested with clears-sel: - The Clear method will remove the /var/log/ipmi_sel files and refresh rsyslog and Record ID count. - Each record has its own unique Record ID. - New records added after restarting xyz.openbmc_project.Logging.IPMI will continue Record ID count where it left off. Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com> Change-Id: I9037aba409eaf99fa06fd8ea84ef888669966eea
The SEL Logger daemon handles all requests to add new IPMI SEL records to the journal. SEL records stored in the journal are identified by the standard MESSAGE_ID metadata. Other metadata fields are used to store event-specific information for each record.
SEL records are identified in the journal using the MESSAGE_ID field.
The MESSAGE_ID for SEL records is "b370836ccf2f4850ac5bee185b77893a".
The additional metadata fields for a SEL record are
IPMI_SEL_RECORD_ID = Two byte unique SEL Record ID IPMI_SEL_RECORD_TYPE = The type of SEL entry (system or OEM) which determines the definition of the remaining bytes IPMI_SEL_GENERATOR_ID = The IPMI Generator ID (usually the IPMB Slave Address) of the requester IPMI_SEL_SENSOR_PATH = D-Bus path of the sensor in the event IPMI_SEL_EVENT_DIR = Direction of the event (assert or deassert) IPMI_SEL_DATA = Raw binary data included in the SEL record
The SEL Logger daemon exposes an interface for manually adding System and OEM type SEL events, and provides the capability to monitor for types of events and log them automatically.
The interface for System type events requires
The interface for OEM type events requires
The MESSAGE_ID and IPMI_SEL_RECORD_ID metadata fields are added by the daemon.
The SEL Logger daemon can be configured to watch for specific types of events and automatically log SEL records for them.
As an example, the SEL Logger has a "threshold event monitor" which implements a D-Bus match for any "PropertiesChanged" event on the "xyz.openbmc_project.Sensor.Threshold" interface. The handler then checks for any new threshold events and logs SEL records accordingly.