How to add Redfish EventLog using commands

Bills, Jason M jason.m.bills at linux.intel.com
Wed May 5 09:14:30 AEST 2021



On 5/4/2021 1:01 PM, Ed Tanous wrote:
> On Tue, May 4, 2021 at 2:54 AM Thang Nguyen
> <thang at os.amperecomputing.com> wrote:
>>
>> Hi,
>>
>> I am looking for the mechanism to add events to Redfish EventLog. I
>> checked on the Redfish EventService design
>> (https://github.com/openbmc/docs/blob/master/designs/redfish-eventservice.md)
>> and it seems only has C++ functional calls (sd_journal_send(),
>> phosphor::logging::log(), ...) but not user commands that can be used in
>> the shell script.
> 
> This kind of logging and handling would imply that your script has
> outlived what should realistically be put in a bash script, and should
> be rewritten in something compiled (probably c++).  Redfish logs
> require string and variable manipulation that is generally not well
> defined in bash scripts.
> 
>>
>> There are many use cases for adding EventLogs:
>>
>> 1. Use phosphor-gpio-monitor to monitor signals like power/reset,
>> button, ... and log the event
> 
> Considering that Redfish event log is for high level things, I suspect
> this isn't a great fit.  power/reset would be handled within whatever
> state system you're using (phosphor-state-manager or
> x86-power-control), right?
> 
>>
>> 2. Use phosphor-gpio-monitor to check if the Host boot fail, control the
>> mux to switch to other boot devices, along with logging events.
> 
> This seems like something that shouldn't be done from bash;
> 
>>
>> 3. Check device presences (from /sys interfaces) and log events, ...
> 
> Redfish itself should have no knowledge of specific linux interfaces,
> or linux at all.  Dependent on the actual /sys device you're looking
> for, there's probably already daemons that expose those types of
> events.  Without going into more specifics, I'm not sure this is
> advised.
> 
>>
>>
>> I checked on existing repositories like phosphor-sel-logger,
>> dbus-sensors, ... and they only support events for their features (like
>> power dc on/off, sensor threshold, inventory data added/removed, ...)
>> and the Redfish events added in C++.
> 
> Which is I think the right design choice.
> 
>>
>> I can have a C++ codes to just support options to add different EventLog
>> data with parameters. But it can't be inside meta- folder so need a
>> repository for it.
> 
> For what it's worth, the bash scripts shouldn't be going in the meta
> repo either.
> 
>> I think it's not worth for creating a new repo just
>> to support an application with dozen like of codes to just add EventLog.
> 
> Disagree about whether it's worth it.  WIth that said, depending on
> what you're trying to do, there's likely already a repo for the
> feature you're trying to implement.
> 
>>
>> Do you have any idea of any existing repo support adding Redfish
>> EventLog from script/command line or any repo that we can extend to
>> support such command?
I completely agree with Ed on making sure it's the right thing to do 
before doing it, but I wanted to share the tool we use in case it's helpful.

For journal-based logging we use 'logger-systemd --journald' in some of 
our scripts to add Redfish event messages to the journal: 
https://github.com/Intel-BMC/openbmc/blob/intel/meta-openbmc-mods/meta-common/recipes-core/fw-update/files/fwupd.sh#L33

>>
>>
>> Best Regards,
>>
>> Thang Q. Nguyen -
>>


More information about the openbmc mailing list