How to add Redfish EventLog using commands
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 -
Quoted 9 lines · Thang Nguyen
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.
Quoted 5 lines
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?
Quoted 3 lines
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;
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 4 lines
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.
Quoted 2 lines
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.
Quoted 10 lines
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 -
Quoted 61 lines · Ed Tanous
Quoted 9 lines · Thang Nguyen
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.
Quoted 5 lines
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?
Quoted 3 lines
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;
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 4 lines
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.
Quoted 11 lines
Quoted 2 lines
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.
Quoted 4 lines
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
Quoted 6 lines
Quoted 6 lines
Best Regards,
Thang Q. Nguyen -
Quoted 73 lines · Jason M
Quoted 70 lines · Ed Tanous
Quoted 10 lines · Thang Nguyen
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.
Quoted 5 lines
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?
Quoted 3 lines
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;
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 4 lines
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.
Quoted 2 lines
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.
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
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?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Best Regards,
Thang Q. Nguyen -
Quoted 10 lines · Ed Tanous
Quoted 8 lines · Thang Nguyen
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.
Quoted 5 lines
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.
Quoted 9 lines
Quoted 5 lines
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.
Quoted 4 lines
Quoted 3 lines
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.
Quoted 7 lines
Quoted 2 lines
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.
Quoted 6 lines
Quoted 6 lines
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++.
Quoted 7 lines
Which is I think the right design choice.
Quoted 3 lines
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.
Quoted 16 lines
Quoted 3 lines
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.
Quoted 9 lines
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 -