From 9e811dd81c449439d1415061204c98ff4fda4d98 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 18 Aug 2026 22:58:48 +0200 Subject: [PATCH] Leave it to OpenBMC to say which of its logs are not events Reading an event log skipped every log service whose id or name said journal, dump, post code, host logger or crash, on every implementation. Those names are bmcweb's: the AMI and Lenovo bmcs call theirs SEL, EventLog, AuditLog and PlatformLog. bmcweb does need the distinction, keeping its event log under the system while a clear would destroy its dumps, so it gets a handler that names the words and generic names none, reading whatever a platform publishes. --- .../aiohmi/redfish/oem/generic.py | 10 ++++---- confluent_server/aiohmi/redfish/oem/lookup.py | 4 ++++ .../aiohmi/redfish/oem/openbmc/__init__.py | 0 .../aiohmi/redfish/oem/openbmc/main.py | 24 +++++++++++++++++++ .../aiohmi/redfish/oem/openbmc/openbmc.py | 22 +++++++++++++++++ confluent_server/setup.py.tmpl | 1 + 6 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 confluent_server/aiohmi/redfish/oem/openbmc/__init__.py create mode 100644 confluent_server/aiohmi/redfish/oem/openbmc/main.py create mode 100644 confluent_server/aiohmi/redfish/oem/openbmc/openbmc.py diff --git a/confluent_server/aiohmi/redfish/oem/generic.py b/confluent_server/aiohmi/redfish/oem/generic.py index cca612a2..7ce2f84d 100644 --- a/confluent_server/aiohmi/redfish/oem/generic.py +++ b/confluent_server/aiohmi/redfish/oem/generic.py @@ -562,12 +562,10 @@ class OEMHandler(object): } yield certdesc - # A log service whose id or name says one of these is not an event log: - # the bmc's own systemd journal, dumps of several kinds, and firmware boot - # progress. Reading them buries the events that were asked for, and - # clearing them destroys diagnostic data that has nothing to do with the - # event log. - noneventlogwords = ('journal', 'dump', 'postcode', 'hostlogger', 'crash') + # Words in a log service's id or name that say it holds something other than + # events. Redfish does not settle what a log service is called, so each + # handler names its platform's and generic reads every service it finds. + noneventlogwords = () @classmethod def is_event_log(cls, loginfo): diff --git a/confluent_server/aiohmi/redfish/oem/lookup.py b/confluent_server/aiohmi/redfish/oem/lookup.py index a56a9508..d08e3c20 100644 --- a/confluent_server/aiohmi/redfish/oem/lookup.py +++ b/confluent_server/aiohmi/redfish/oem/lookup.py @@ -17,6 +17,7 @@ import aiohmi.redfish.oem.generic as generic import aiohmi.redfish.oem.lenovo.main as lenovo import aiohmi.redfish.oem.ami.main as ami import aiohmi.redfish.oem.megware.main as megware +import aiohmi.redfish.oem.openbmc.main as openbmc OEMMAP = { 'Lenovo': lenovo, @@ -24,6 +25,9 @@ OEMMAP = { 'AMI': ami, 'Ami': ami, 'Megware': megware, + # bmcweb spells its oem key OpenBmc on the manager and OpenBMC elsewhere + 'OpenBMC': openbmc, + 'OpenBmc': openbmc, } diff --git a/confluent_server/aiohmi/redfish/oem/openbmc/__init__.py b/confluent_server/aiohmi/redfish/oem/openbmc/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/confluent_server/aiohmi/redfish/oem/openbmc/main.py b/confluent_server/aiohmi/redfish/oem/openbmc/main.py new file mode 100644 index 00000000..c9eedb8f --- /dev/null +++ b/confluent_server/aiohmi/redfish/oem/openbmc/main.py @@ -0,0 +1,24 @@ +# Copyright 2026 MEGWARE Computer Vertrieb und Service GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +OEM handler for the OpenBMC (bmcweb) redfish service. +""" + +import aiohmi.redfish.oem.openbmc.openbmc as openbmc + + +async def get_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): + return await openbmc.OEMHandler.create(sysinfo, sysurl, webclient, cache, + gpool=cmd._gpool, rootinfo=rootinfo) diff --git a/confluent_server/aiohmi/redfish/oem/openbmc/openbmc.py b/confluent_server/aiohmi/redfish/oem/openbmc/openbmc.py new file mode 100644 index 00000000..a2b29797 --- /dev/null +++ b/confluent_server/aiohmi/redfish/oem/openbmc/openbmc.py @@ -0,0 +1,22 @@ +# Copyright 2026 MEGWARE Computer Vertrieb und Service GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import aiohmi.redfish.oem.generic as generic + + +class OEMHandler(generic.OEMHandler): + # bmcweb keeps its journal, dumps, post codes and console capture under the + # manager and the event log under the system, so reading those buries the + # events asked for and clearing them destroys diagnostic data. + noneventlogwords = ('journal', 'dump', 'postcode', 'hostlogger', 'crash') diff --git a/confluent_server/setup.py.tmpl b/confluent_server/setup.py.tmpl index b9e36932..49de294b 100644 --- a/confluent_server/setup.py.tmpl +++ b/confluent_server/setup.py.tmpl @@ -34,6 +34,7 @@ setup( 'aiohmi/redfish/oem/lenovo', 'aiohmi/redfish/oem/ami', 'aiohmi/redfish/oem/megware', + 'aiohmi/redfish/oem/openbmc', 'aiohmi/util'], scripts=['bin/confluent', 'bin/confluent_selfcheck', 'bin/confluentdbutil', 'bin/collective', 'bin/osdeploy'], data_files=[('/etc/init.d', ['sysvinit/confluent']),