<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Jason and Lei Yu,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your sharing.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am able to see the sel in the /var/log/ipmi_sel as same as Jason mentioned and also see the sel by the "ipmitool sel list" command.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However, for Lei's suggestion of adding "send-to-logger" configuration, I really can see it becomes an entry in /xyz/openbmc_project/logging/entry/X rather than saving the message in the /var/log/ipmi_sel, but I can't see any sel entry by the "ipmitool sel
list" command. It looks like the ipmid doesn't parse the entry into an SEL record. Is it the sel entry I added (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) just a sample not a formal info? or due to other reasons?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Chris Chen</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>寄件者:</b> openbmc <openbmc-bounces+chris.chen3=flex.com@lists.ozlabs.org> 代表 Lei Yu <yulei.sh@bytedance.com><br>
<b>寄件日期:</b> 2021年10月26日 上午 10:38<br>
<b>收件者:</b> Bills, Jason M <jason.m.bills@linux.intel.com><br>
<b>副本:</b> openbmc <openbmc@lists.ozlabs.org><br>
<b>主旨:</b> Re: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Tue, Oct 26, 2021 at 5:09 AM Bills, Jason M<br>
<jason.m.bills@linux.intel.com> wrote:<br>
><br>
><br>
><br>
> On 10/25/2021 5:02 AM, Chris Chen (TPI) wrote:<br>
> > Hi all,<br>
> ><br>
> > I for now have added rsyslog and phosphor-sel-logger packages to build<br>
> > the image, then I could see the xyz.openbmc_project.Logging.IPMI through<br>
> > the busctl command after the system runs up.<br>
> ><br>
> > From this link,<br>
> > <a href="https://urldefense.com/v3/__https://lists.ozlabs.org/pipermail/openbmc/2019-October/018640.html__;!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWMdd7F0-$">
https://urldefense.com/v3/__https://lists.ozlabs.org/pipermail/openbmc/2019-October/018640.html__;!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWMdd7F0-$</a>
<br>
> > <<a href=""></a>https://urldefense.com/v3/__https://lists.ozlabs.org/pipermail/openbmc/2019-October/018640.html__;!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWMdd7F0-$ >, I<br>
> > understand that I should be able to add a journal entry that has the<br>
> > IPMI SEL MESSAGE_ID: "b370836ccf2f4850ac5bee185b77893a" to test the<br>
> > feature, but I don't know to give the correct parameters to the method<br>
> > call, IpmiSelAdd, as below,<br>
> ><br>
> > ~# busctl call xyz.openbmc_project.Logging.IPMI<br>
> > /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI<br>
> > IpmiSelAdd xxx<br>
> ><br>
> > Could someone help me out on this? Thank you.<br>
> You can find the implementation for IpmiSelAdd, here:<br>
> <a href="https://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/src/sel_logger.cpp*L270__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWAPFsP5v$">
https://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/src/sel_logger.cpp*L270__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWAPFsP5v$</a> .<br>
><br>
> "IpmiSelAdd", [](const std::string& message, const std::string& path,<br>
> const std::vector<uint8_t>& selData,<br>
> const bool& assert, const uint16_t& genId)<br>
><br>
> Where<br>
> message = the string to set as the MESSAGE in the journal<br>
> path = the D-Bus path to the sensor that logged the event<br>
> selData = the raw bytes of the IPMI SEL entry<br>
> assert = the event direction of the SEL event<br>
> genId = the Generator ID for the SEL event<br>
><br>
> The busctl format is 'ssaybq', so a sample command is<br>
> busctl call xyz.openbmc_project.Logging.IPMI<br>
> /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI<br>
> IpmiSelAdd ssaybq "helloworld" "/xyz/openbmc_project/Test" 3 16 32 64<br>
> true 0x81<br>
><br>
> This should add an IPMI message to the journal that is picked up by<br>
> rsyslog and sent to /var/log/ipmi_sel like this:<br>
><br>
> root@intel-obmc:~# cat /var/log/ipmi_sel<br>
> 2021-08-20T01:16:48.747428+00:00 1,2,102040,81,/xyz/openbmc_project/Test,1<br>
><br>
<br>
There is a configuration option send-to-logger[1] that changes the<br>
behavior of `IpmiSelAdd`.<br>
With the config enabled, `IpmiSelAdd()` sends the log to<br>
phosphor-logging service and becomes an entry in<br>
/xyz/openbmc_project/logging/entry/, instead of saving the message in<br>
/var/log/ipmi_sel.<br>
And ipmid will parse the entry into an SEL record.<br>
<br>
[1]: <a href="https://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/meson.build*L31__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWERbrnIZ$">
https://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/meson.build*L31__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWERbrnIZ$</a>
<br>
<br>
<br>
-- <br>
BRs,<br>
Lei YU<br>
</div>
</span></font></div>
</div>
<DIV>
Legal Disclaimer :<BR>
The information contained in this message may be privileged and confidential. <BR>
It is intended to be read only by the individual or entity to whom it is addressed <BR>
or by their designee. If the reader of this message is not the intended recipient, <BR>
you are on notice that any distribution of this message, in any form, <BR>
is strictly prohibited. If you have received this message in error, <BR>
please immediately notify the sender and delete or destroy any copy of this message!<BR>
</DIV></body>
</html>