Host console logs service

Artem Senichev artemsen at gmail.com
Thu Oct 25 02:55:21 AEDT 2018


Hi All,

As you know, OpenBMC contains obmc-console project that intended to
work with host's console. It's very useful that omc-console-server
stores last logs inside its ring buffer, but it would be better to
make the log collector more smarter.

On our VESNIN server, we have an own extension of obmc-console - it is
a standalone service that reads log messages from obmc-console-server,
marks each message with a timestamp and save it to an internal memory
buffer. We have a custom policy that determines how large a buffer can
be (limit by time or message numbers), in which cases the buffer
should be flushed to a file, and how many previous log files can be
saved on a flash drive (some kind of rotation).
By default the buffer has limit of 3000 messages and it flushed to a
file on every significant host state change (host on/off, OS boot
complete). This gives us the opportunity to store not only the latest
messages, but also the logs of the last boot process separately
(hostboot, skiboot, etc).

So, if you find this service useful for the OpenBMC project, we can
upload the source code to the community.

Sources:
https://github.com/YADRO-KNS/phosphor-hostlogger

Small demo:
# ls -lA /var/lib/obmc/hostlogs
-rw-r--r--    1 root     root          6336 Oct 24 09:26
host_20181024_092655.log.gz
-rw-r--r--    1 root     root          9589 Oct 24 11:43
host_20181024_114342.log.gz
-rw-r--r--    1 root     root          6547 Oct 24 12:01
host_20181024_120119.log.gz
# zcat /var/lib/obmc/hostlogs/host_20181024_120119.log.gz
[ 11:55:02 ]: >>> Log collection started at 24.10.2018 11:55:02
[ 11:55:02 ]: --== Welcome to Hostboot v2.1-199-g38a9f30-dirty/hbicore.bin/ ==--
[ 11:55:06 ]:   5.66868|ISTEP  6. 3 - host_init_fsi
[ 11:55:06 ]:   6.27102|ISTEP  6. 4 - host_set_ipl_parms
[ 11:55:06 ]:   6.27234|ISTEP  6. 5 - host_discover_targets
...

Best regards,
Artem Senichev
Software Engineer, YADRO.


More information about the openbmc mailing list