All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bills, Jason M" <jason.m.bills@linux.intel.com>
To: "Will Liang (梁永鉉)" <Will.Liang@quantatw.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: A question about phosphor-sel-logger
Date: Fri, 3 May 2019 16:57:04 -0700	[thread overview]
Message-ID: <bcd254dd-cbc6-abb0-f618-265d8644df43@linux.intel.com> (raw)
In-Reply-To: <2b26e8a78f5548bc9d68349e5323b861@quantatw.com>



On 5/2/2019 8:39 PM, Will Liang (梁永鉉) wrote:
> Hi Jason,
> 
> I am very thankful that you reply me quickly and it's great to hear that you are working on this issue.
> If you can share your rsyslog configuration with me that will be a good news for me, I can trace it first.
I will share my rsyslog configuration file below.  It requires the 
imjournal module to be installed which can be done by adding 
'PACKAGECONFIG_append = " imjournal"' to an rsyslog_%.bbappend file.

> 
> According to the above URL, is it something I missed, I did not find the "add sel" to sys log function?

If the imjournal rsyslog module works well enough, then the "add sel" 
function won't need to change.  SEL entries will still be added to the 
journal and the imjournal module will read the journal to find new SEL 
entries for rsyslog to save to the SEL log file.

> I wander to know how you add sel to sys log. Or you want to share it after internal testing.
> 
I'm willing to share whatever you are interested in, but it may change 
if internal testing finds issues.  I'm planning to push the entire 
solution once we complete initial internal testing.

For clearing the log to work, you need to add "Reload" support to the 
rsyslog service file.  I do this by adding this line to an override 
.conf file:
ExecReload=/bin/kill -HUP $MAINPID

Here is my rsyslog.conf file which configures the entries the imjournal 
module is looking for and how to format them in the syslog files:
# if you experience problems, check
# http://www.rsyslog.com/troubleshoot for assistance

# rsyslog v3: load input modules
# If you do not load inputs, nothing happens!
# You may need to set the module load path if modules are not found.
#
# Ported from debian's sysklogd.conf

# Journal-style logging
# Limit to no more than 2000 entries in one minute and enable the
# journal workaround to avoid duplicate entries
module(load="imjournal" StateFile="/var/log/state"
                         RateLimit.Interval="60"
                         RateLimit.Burst="2000"
                         WorkAroundJournalBug="on")

# Template for IPMI SEL messages
# "<timestamp> <ID>,<Type>,<EventData>,[<Generator ID>,<Path>,<Direction>]"
template(name="IPMISELTemplate" type="list") {
     property(name="timereported" dateFormat="rfc3339")
     constant(value=" ")
     property(name="$!IPMI_SEL_RECORD_ID")
     constant(value=",")
     property(name="$!IPMI_SEL_RECORD_TYPE")
     constant(value=",")
     property(name="$!IPMI_SEL_DATA")
     constant(value=",")
     property(name="$!IPMI_SEL_GENERATOR_ID")
     constant(value=",")
     property(name="$!IPMI_SEL_SENSOR_PATH")
     constant(value=",")
     property(name="$!IPMI_SEL_EVENT_DIR")
     constant(value="\n")
}

# Template for Redfish messages
# "<timestamp> <MessageId>,<MessageArgs>"
template(name="RedfishTemplate" type="list") {
     property(name="timereported" dateFormat="rfc3339")
     constant(value=" ")
     property(name="$!REDFISH_MESSAGE_ID")
     constant(value=",")
     property(name="$!REDFISH_MESSAGE_ARGS")
     constant(value="\n")
}

# If the journal entry has the IPMI SEL MESSAGE_ID, save as IPMI SEL
if ($!MESSAGE_ID == "b370836ccf2f4850ac5bee185b77893a") then {
    action(type="omfile" file="/var/log/ipmi_sel" 
template="IPMISELTemplate")
}

# If the journal entry has a Redfish MessageId, save as a Redfish event
if ($!REDFISH_MESSAGE_ID != "") then {
    action(type="omfile" file="/var/log/redfish" template="RedfishTemplate")
}

#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf

      reply	other threads:[~2019-05-03 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02  2:36 A question about phosphor-sel-logger Will Liang (梁永鉉)
2019-05-02 15:52 ` Bills, Jason M
2019-05-03  3:39   ` Will Liang (梁永鉉)
2019-05-03 23:57     ` Bills, Jason M [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcd254dd-cbc6-abb0-f618-265d8644df43@linux.intel.com \
    --to=jason.m.bills@linux.intel.com \
    --cc=Will.Liang@quantatw.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.