Trigger Redfish Log in PSU Event
When PSU Event is asserted, trigger Redfish Log.
Tested:
Plug out AC cable on PSU2, we can see below in Redfish Log Entries.
{
"@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
data.context": "/redfish/v1/$metadata#LogEntry.LogEntry",
"@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/
Entries/#1562158096",
"@odata.type": "#LogEntry.v1_4_0.LogEntry",
"Created": "2019-07-03T12:48:16+00:00",
"EntryType": "Event",
"Id": "1562158096",
"Message": "Power supply PSU2 AC power lost.",
"MessageArgs": [
"PSU2"
],
"MessageId": "OpenBMC.0.1.PowerSupplyACLost",
"Name": "System Event Log Entry",
"Severity": "Critical"
},
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>
Change-Id: I406dbf2047e82ccf523dcea91dce48600341aaee
diff --git a/include/PSUEvent.hpp b/include/PSUEvent.hpp
index f7834e2..104b910 100644
--- a/include/PSUEvent.hpp
+++ b/include/PSUEvent.hpp
@@ -26,7 +26,7 @@
const std::string& eventName,
std::shared_ptr<std::set<std::string>> asserts,
std::shared_ptr<std::set<std::string>> combineEvent,
- std::shared_ptr<bool> state);
+ std::shared_ptr<bool> state, const std::string& psuName);
~PSUSubEvent();
std::shared_ptr<sdbusplus::asio::dbus_interface> eventInterface;
@@ -47,6 +47,9 @@
boost::asio::posix::stream_descriptor inputDev;
static constexpr unsigned int eventPollMs = 1000;
static constexpr size_t warnAfterErrorCount = 10;
+ std::string psuName;
+ std::string fanName;
+ std::string messageID = "";
};
class PSUCombineEvent