[Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually

Lei Yu yulei.sh at bytedance.com
Tue Oct 26 13:38:05 AEDT 2021


On Tue, Oct 26, 2021 at 5:09 AM Bills, Jason M
<jason.m.bills at linux.intel.com> wrote:
>
>
>
> On 10/25/2021 5:02 AM, Chris Chen (TPI) wrote:
> > Hi all,
> >
> > I for now have added rsyslog and phosphor-sel-logger packages to build
> > the image, then I could see the xyz.openbmc_project.Logging.IPMI through
> > the busctl command after the system runs up.
> >
> >  From this link,
> > https://lists.ozlabs.org/pipermail/openbmc/2019-October/018640.html
> > <https://lists.ozlabs.org/pipermail/openbmc/2019-October/018640.html>, I
> > understand that I should be able to add a journal entry that has the
> > IPMI SEL MESSAGE_ID: "b370836ccf2f4850ac5bee185b77893a" to test the
> > feature, but I don't know to give the correct parameters to the method
> > call, IpmiSelAdd, as below,
> >
> > ~# busctl call xyz.openbmc_project.Logging.IPMI
> > /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI
> > IpmiSelAdd xxx
> >
> > Could someone help me out on this? Thank you.
> You can find the implementation for IpmiSelAdd, here:
> https://github.com/openbmc/phosphor-sel-logger/blob/master/src/sel_logger.cpp#L270.
>
> "IpmiSelAdd", [](const std::string& message, const std::string& path,
>                      const std::vector<uint8_t>& selData,
>                      const bool& assert, const uint16_t& genId)
>
> Where
> message = the string to set as the MESSAGE in the journal
> path = the D-Bus path to the sensor that logged the event
> selData = the raw bytes of the IPMI SEL entry
> assert = the event direction of the SEL event
> genId = the Generator ID for the SEL event
>
> The busctl format is 'ssaybq', so a sample command is
> busctl call xyz.openbmc_project.Logging.IPMI
> /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI
> IpmiSelAdd ssaybq "helloworld" "/xyz/openbmc_project/Test" 3 16 32 64
> true 0x81
>
> This should add an IPMI message to the journal that is picked up by
> rsyslog and sent to /var/log/ipmi_sel like this:
>
> root at intel-obmc:~# cat /var/log/ipmi_sel
> 2021-08-20T01:16:48.747428+00:00 1,2,102040,81,/xyz/openbmc_project/Test,1
>

There is a configuration option send-to-logger[1] that changes the
behavior of `IpmiSelAdd`.
With the config enabled, `IpmiSelAdd()` sends the log to
phosphor-logging service and becomes an entry in
/xyz/openbmc_project/logging/entry/, instead of saving the message in
/var/log/ipmi_sel.
And ipmid will parse the entry into an SEL record.

[1]: https://github.com/openbmc/phosphor-sel-logger/blob/master/meson.build#L31


-- 
BRs,
Lei YU


More information about the openbmc mailing list