| commit | b7028ebff16566762b71cdbc597c1244529d208a | [log] [tgz] |
|---|---|---|
| author | Spencer Ku <Spencer.Ku@quantatw.com> | Tue Oct 26 15:27:35 2021 +0800 |
| committer | Spencer Ku <Spencer.Ku@quantatw.com> | Thu Nov 04 08:05:26 2021 +0800 |
| tree | 9236974696dac002cb871578ab289572582880ae | |
| parent | c52ee72b01507e3ee1fca3fdf79c1d2748439357 [diff] |
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/<str>
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".
Sample Output:
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/HostLogger/
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger",
"@odata.type": "#LogService.v1_1_0.LogService",
"Description": "Host Logger Service",
"Entries": {
"@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries"
},
"Id": "HostLogger",
"Name": "Host Logger Service"
}
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/0",
"@odata.type": "#LogEntry.v1_4_0.LogEntry",
"EntryType": "Oem",
"Id": "0",
"Message": "123123",
"Name": "Host Logger Entry",
"OemRecordFormat": "Host Logger Entry",
"Severity": "OK"
}
],
"Members@odata.count": 1,
"Name": "HostLogger Entries"
}
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/HostLogger/Entries/0
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/HostLogger/Entries/0",
"@odata.type": "#LogEntry.v1_4_0.LogEntry",
"EntryType": "Oem",
"Id": "0",
"Message": "123123",
"Name": "Host Logger Entry",
"OemRecordFormat": "Host Logger Entry",
"Severity": "OK"
}
Signed-off-by: Spencer Ku <Spencer.Ku@quantatw.com>
Change-Id: I4ad2652a80fb1c441a25382b7d422ecd7ffc8557
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D flags that correspond to options in bmcweb/meson_options.txt and then compiling. For example, meson <builddir> -Dkvm=disabled ... followed by ninja in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja coverage -C builddir test
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1 algorithm. The certificate
C=US, O=OpenBMC, CN=testhost,SHA-256 algorithm.