diff options
author | Amithash Prasasd <amithash@meta.com> | 2024-01-17 03:13:48 +0300 |
---|---|---|
committer | Amithash Prasad <amithash@meta.com> | 2024-01-25 06:18:00 +0300 |
commit | 34247ac9d662f02d39c8d1fbb24dc0ba80cdc0fd (patch) | |
tree | fde9e3fb84f29d567bf7845ad6bafa65ef85df1f | |
parent | 339940db155e80766bf649d93d011a03766473ba (diff) | |
download | openbmc-34247ac9d662f02d39c8d1fbb24dc0ba80cdc0fd.tar.xz |
meta-facebook: rsyslog: Allow reading server console logs
Generate host server log files to load logs from obmc-console.
This allows us to input /var/log/obmc-console*.log and
potentially be able to stream it to an external syslog
server (if configured to do so).
Change-Id: I8146f499a47971501b3abe85e6d8026216d3d0b4
Signed-off-by: Amithash Prasasd <amithash@meta.com>
3 files changed, 30 insertions, 0 deletions
diff --git a/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog-oob-console.conf.in b/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog-oob-console.conf.in new file mode 100644 index 0000000000..559798b3d5 --- /dev/null +++ b/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog-oob-console.conf.in @@ -0,0 +1,17 @@ +# Do not queue these, write immediately +$ActionQueueType Direct + +# Send all console logs out as local3.debug logs. +# local3 is an arbitrary choice among local1-7 +# to ensure we dont conflict with other services. +# reopenOnTruncate+freshStartTail - ensures we +# reopen when obmc-console rotates the log-file +# and start a fresh on the new file. +input(type="imfile" + File="/var/log/obmc-console-__OOB_CONSOLE_HOST__.log" + Tag="oob_console[mTerm___OOB_CONSOLE_HOST__]" + Severity="debug" + Facility="local3" + reopenOnTruncate="on" + freshStartTail="on" +) diff --git a/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog.conf b/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog.conf index e84f7a5749..d59ca0811c 100644 --- a/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog.conf +++ b/meta-facebook/recipes-extended/rsyslog/rsyslog/rsyslog.conf @@ -48,6 +48,10 @@ if ($!IPMISEL_MESSAGE_ID != "") then { if ($!REDFISH_MESSAGE_ID != "") then { action(type="omfile" file="/var/log/redfish" template="RedfishTemplate") } + +# At least one of the consoles will require streaming host console. +module(load="imfile") + # # Include all config files in /etc/rsyslog.d/ # diff --git a/meta-facebook/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-facebook/recipes-extended/rsyslog/rsyslog_%.bbappend index e60b3e83fb..5fd46bd70e 100644 --- a/meta-facebook/recipes-extended/rsyslog/rsyslog_%.bbappend +++ b/meta-facebook/recipes-extended/rsyslog/rsyslog_%.bbappend @@ -1,9 +1,12 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +require conf/recipes/fb-consoles.inc + SRC_URI += "file://rsyslog.conf \ file://rsyslog.logrotate \ file://rotate-event-logs.service \ file://rotate-event-logs.timer \ + file://rsyslog-oob-console.conf.in \ " PACKAGECONFIG:append = " imjournal klog imfile" @@ -12,6 +15,12 @@ do_install:append() { install -m 0644 ${WORKDIR}/rotate-event-logs.service ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/rotate-event-logs.timer ${D}${systemd_system_unitdir} rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf + for host in ${OBMC_HOST_INSTANCES}; do + host_name="host${host}" + conf=${D}${sysconfdir}/rsyslog.d/${host_name}.conf + install -m 644 ${WORKDIR}/rsyslog-oob-console.conf.in ${conf} + sed -i "s/__OOB_CONSOLE_HOST__/${host_name}/g;" ${conf} + done } SYSTEMD_SERVICE:${PN} += " rotate-event-logs.service rotate-event-logs.timer" |