From bf888502a247d8374c70e7ceddc9862bf0ad88bd Mon Sep 17 00:00:00 2001 From: SpencerKu Date: Thu, 22 Jul 2021 14:57:02 +0800 Subject: Redfish: Support Host Log Entries This commit is designing and implementing a new logging service in Redfish to expose host serial console logs.The goal is that clients can talk to bmc via Redfish and get a real-time console. It will improve the debuggability of BMCs. We will add three paths to redfish tree to implement the feature: 1. /redfish/v1/Systems/system/LogServices/HostLogger 2. /redfish/v1/Systems/system/LogServices/HostLogger/Entries 3. /redfish/v1/Systems/system/LogServices/HostLogger/Entries/ To use this feature, we expect to use phosphor-hostlogger(stream mode) + rsyslog + bmcweb. Phosphor-hostlooger in stream mode forwards the byte stream into rsyslog via the imuxsock module. The log is persisted via the omfile module as soon as collected. It makes Host Logger leverage exsisting tools (rsyslog and logrotate). Then we can expose host serial console logs via bmcweb. This feature can be enabled or disabled by setting the option "redfish-host-logger", and the default value is "enabled". If you don't want to expose host serial console logs, you need to turn the value to "disabled". RedfishServiceValidator results: /redfish/v1/Systems/system/LogServices/HostLogger pass: 4 passGet: 1 skipOptional: 9 /redfish/v1/Systems/system/LogServices/HostLogger/Entries pass: 24 passGet: 1 skipOptional: 1 /redfish/v1/Systems/system/LogServices/HostLogger/Entries/ pass: 7 passGet: 1 skipOptional: 15 Sample Output: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/HostLogger/Entries { "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries", "@odata.type": "#LogEntryCollection.LogEntryCollection", "Description": "Collection of HostLogger Entries", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/1", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "EntryType": "Event", "Id": "1", "Message": "[ 57.061546] gq 0000:16:00.0 eth0: link up, 100 Gbps, no PAUSE", "MessageArgs": [ "[ 57.061546] gq 0000:16:00.0 eth0: link up, 100 Gbps, no PAUSE" ], "MessageId": "OpenBMC.0.1.SerialLogAdded", "Name": "HostLogger Entries", "Severity": "OK" }, ... ], "Members@odata.count": 22, "Name": "HostLogger Entries" } Signed-off-by: SpencerKu Change-Id: I5a7873caa117400fb0a737588a50bd743e8b5063 --- meson_options.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'meson_options.txt') diff --git a/meson_options.txt b/meson_options.txt index ada1957e8b..6c0f6434c4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -19,6 +19,7 @@ option('redfish-bmc-journal', type : 'feature', value : 'disabled', description option('redfish-cpu-log', type : 'feature', value : 'disabled', description : '''Enable CPU log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/Crashdump'.''') option('redfish-dump-log', type : 'feature', value : 'disabled', description : 'Enable Dump log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/Dump\'and \'/redfish/v1/Managers/bmc/LogServices/Dump\'') option('redfish-dbus-log', type : 'feature', value : 'disabled', description : 'Enable DBUS log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/EventLog/Entries\'') +option('redfish-host-logger', type : 'feature', value : 'enabled', description : 'Enable host log service transactions based on phosphor-hostlogger through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/HostLogger\'') option('redfish-provisioning-feature', type : 'feature', value : 'disabled', description : 'Enable provisioning feature support in redfish. Paths are under \'/redfish/v1/Systems/system/\'') option('bmcweb-logging', type : 'feature', value : 'disabled', description : 'Enable output the extended debug logs') option('basic-auth', type : 'feature', value : 'enabled', description : '''Enable basic authentication''') -- cgit v1.2.3