All of lore.kernel.org
 help / color / mirror / Atom feed
* How to add Redfish EventLog using commands
@ 2021-05-04  9:53 Thang Nguyen
  2021-05-04 20:01 ` Ed Tanous
  0 siblings, 1 reply; 5+ messages in thread
From: Thang Nguyen @ 2021-05-04  9:53 UTC (permalink / raw)
  To: OpenBMC Maillist

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.

There are many use cases for adding EventLogs:

1. Use phosphor-gpio-monitor to monitor signals like power/reset, 
button, ... and log the event

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.

3. Check device presences (from /sys interfaces) and log events, ...


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++.

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. 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.

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 -


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to add Redfish EventLog using commands
  2021-05-04  9:53 How to add Redfish EventLog using commands Thang Nguyen
@ 2021-05-04 20:01 ` Ed Tanous
  2021-05-04 23:14   ` Bills, Jason M
  2021-05-05  2:48   ` Thang Nguyen
  0 siblings, 2 replies; 5+ messages in thread
From: Ed Tanous @ 2021-05-04 20:01 UTC (permalink / raw)
  To: Thang Nguyen; +Cc: OpenBMC Maillist

On Tue, May 4, 2021 at 2:54 AM Thang Nguyen
<thang@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?
>
>
> Best Regards,
>
> Thang Q. Nguyen -
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to add Redfish EventLog using commands
  2021-05-04 20:01 ` Ed Tanous
@ 2021-05-04 23:14   ` Bills, Jason M
  2021-05-11  3:23     ` Thang Nguyen
  2021-05-05  2:48   ` Thang Nguyen
  1 sibling, 1 reply; 5+ messages in thread
From: Bills, Jason M @ 2021-05-04 23:14 UTC (permalink / raw)
  To: openbmc



On 5/4/2021 1:01 PM, Ed Tanous wrote:
> On Tue, May 4, 2021 at 2:54 AM Thang Nguyen
> <thang@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 -
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to add Redfish EventLog using commands
  2021-05-04 20:01 ` Ed Tanous
  2021-05-04 23:14   ` Bills, Jason M
@ 2021-05-05  2:48   ` Thang Nguyen
  1 sibling, 0 replies; 5+ messages in thread
From: Thang Nguyen @ 2021-05-05  2:48 UTC (permalink / raw)
  To: Ed Tanous; +Cc: OpenBMC Maillist


On 05/05/2021 03:01, Ed Tanous wrote:
> On Tue, May 4, 2021 at 2:54 AM Thang Nguyen
> <thang@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 -
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to add Redfish EventLog using commands
  2021-05-04 23:14   ` Bills, Jason M
@ 2021-05-11  3:23     ` Thang Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Thang Nguyen @ 2021-05-11  3:23 UTC (permalink / raw)
  To: openbmc


On 05/05/2021 06:14, Bills, Jason M wrote:
>
>
> On 5/4/2021 1:01 PM, Ed Tanous wrote:
>> On Tue, May 4, 2021 at 2:54 AM Thang Nguyen
>> <thang@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 
>
Thanks Bills for your information. This approach works for me. However, 
need to rebuild logger-systemd as it is not ready in OpenBMC. Any chance 
for OpenBMC support logger-systemd by default?
>
>>>
>>>
>>> Best Regards,
>>>
>>> Thang Q. Nguyen -
>>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-11  3:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04  9:53 How to add Redfish EventLog using commands Thang Nguyen
2021-05-04 20:01 ` Ed Tanous
2021-05-04 23:14   ` Bills, Jason M
2021-05-11  3:23     ` Thang Nguyen
2021-05-05  2:48   ` Thang Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.