From 4aec5d06d6adbaf53dbe7f18ea9f803eb2198b86 Mon Sep 17 00:00:00 2001 From: Richard Marian Thomaiyar Date: Mon, 30 Sep 2019 12:09:49 +0530 Subject: special-mode-mgr: Log events for mfg mode change Support added to log events for mfg mode, which can be viewed using Redfish event log entries. This will indicate, whenever manufacturing mode is entered or exited. Tested: Tested the same with up-stream message entry review https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/25687/ 1. Redfish validator - passed for this new addition 2. Log will be as below (for both tampering and normalized) { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/317", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "1970-01-01T00:05:17+00:00", "EntryType": "Event", "Id": "317", "Message": "Entered Manufacturing Mode", "MessageArgs": [], "MessageId": "OpenBMC.0.1.ManufacturingModeEntered", "Name": "System Event Log Entry", "Severity": "Critical" }, { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/899", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "1970-01-01T00:14:59+00:00", "EntryType": "Event", "Id": "899", "Message": "Exited Manufacturing Mode", "MessageArgs": [], "MessageId": "OpenBMC.0.1.ManufacturingModeExited", "Name": "System Event Log Entry", "Severity": "OK" } Change-Id: I417e5bd2e179592e1be0083eeb8759e348554bff Signed-off-by: Richard Marian Thomaiyar --- special-mode-mgr/src/specialmodemgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/special-mode-mgr/src/specialmodemgr.cpp b/special-mode-mgr/src/specialmodemgr.cpp index 93f36e5..f1ed722 100644 --- a/special-mode-mgr/src/specialmodemgr.cpp +++ b/special-mode-mgr/src/specialmodemgr.cpp @@ -175,6 +175,9 @@ void SpecialModeMgr::checkAndAddSpecialModeProperty(const std::string& provMode) { specialMode = manufacturingMode; specialModeLockoutSeconds = mtmAllowedTime - sysInfo.uptime; + sd_journal_send("MESSAGE=%s", "Manufacturing mode - Entered", + "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", + "OpenBMC.0.1.ManufacturingModeEntered", NULL); } addSpecialModeProperty(); if (!specialModeLockoutSeconds) @@ -229,6 +232,9 @@ void SpecialModeMgr::updateTimer(int countInSeconds) } iface->set_property(strSpecialMode, static_cast(manufacturingExpired)); + sd_journal_send("MESSAGE=%s", "Manufacturing mode - Exited", + "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", + "OpenBMC.0.1.ManufacturingModeExited", NULL); }); } -- cgit v1.2.3