How to add Redfish EventLog using commands

Thang Nguyen thang at os.amperecomputing.com
Wed May 5 12:48:17 AEST 2021


On 05/05/2021 03:01, 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.
Written in C++ will add a need for additional repositories for simple 
features. And it seems not recommended.
>
>> 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?

Agreed with you that some standard GPIO devices like power buttons and 
reset should be handled in applications like phosphor-state-manager. But 
for non-standard button like UID (to turn the UID LED on/off), VGA 
switch, ...

Any event should be logged.

>
>> 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;
Currently I create internal repository to handle this in C++. But I 
think we can have simpler solution by using phosphor-gpio-monitor to 
monitor a GPIO (and control other GPIOs) and ability to log events.
>
>> 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 think it can refer to 
https://github.com/openbmc/openbmc/blob/master/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh 
but just replace IPMI SEL by Redfish event log.
>
>>
>> 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.
But I can find many sh scripts in meta- folders. It goes with other recipes.
>
>> 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?
>>
>>
>> Best Regards,
>>
>> Thang Q. Nguyen -
>>


More information about the openbmc mailing list