* [phosphor-sel-logger] How to add a journal entry manually @ 2021-10-25 11:02 Chris Chen (TPI) 2021-10-25 21:07 ` Bills, Jason M 0 siblings, 1 reply; 6+ messages in thread From: Chris Chen (TPI) @ 2021-10-25 11:02 UTC (permalink / raw) To: openbmc [-- Attachment #1: Type: text/plain, Size: 1234 bytes --] 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, 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. Regards, Chris Chen. Legal Disclaimer : The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message! [-- Attachment #2: Type: text/html, Size: 4537 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [phosphor-sel-logger] How to add a journal entry manually 2021-10-25 11:02 [phosphor-sel-logger] How to add a journal entry manually Chris Chen (TPI) @ 2021-10-25 21:07 ` Bills, Jason M 2021-10-26 2:38 ` [Phishing Risk] [External] " Lei Yu 0 siblings, 1 reply; 6+ messages in thread From: Bills, Jason M @ 2021-10-25 21:07 UTC (permalink / raw) To: openbmc 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@intel-obmc:~# cat /var/log/ipmi_sel 2021-08-20T01:16:48.747428+00:00 1,2,102040,81,/xyz/openbmc_project/Test,1 > > Regards, > > Chris Chen. > > Legal Disclaimer : > The information contained in this message may be privileged and > confidential. > It is intended to be read only by the individual or entity to whom it is > addressed > or by their designee. If the reader of this message is not the intended > recipient, > you are on notice that any distribution of this message, in any form, > is strictly prohibited. If you have received this message in error, > please immediately notify the sender and delete or destroy any copy of > this message! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually 2021-10-25 21:07 ` Bills, Jason M @ 2021-10-26 2:38 ` Lei Yu 2021-10-26 6:14 ` 回覆: " Chris Chen (TPI) 0 siblings, 1 reply; 6+ messages in thread From: Lei Yu @ 2021-10-26 2:38 UTC (permalink / raw) To: Bills, Jason M; +Cc: openbmc On Tue, Oct 26, 2021 at 5:09 AM Bills, Jason M <jason.m.bills@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@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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* 回覆: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually 2021-10-26 2:38 ` [Phishing Risk] [External] " Lei Yu @ 2021-10-26 6:14 ` Chris Chen (TPI) 2021-10-26 6:24 ` Lei YU 0 siblings, 1 reply; 6+ messages in thread From: Chris Chen (TPI) @ 2021-10-26 6:14 UTC (permalink / raw) To: Lei Yu, Bills, Jason M; +Cc: openbmc [-- Attachment #1: Type: text/plain, Size: 4747 bytes --] Hi Jason and Lei Yu, Thanks for your sharing. 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. 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? Regards, Chris Chen ________________________________ 寄件者: openbmc <openbmc-bounces+chris.chen3=flex.com@lists.ozlabs.org> 代表 Lei Yu <yulei.sh@bytedance.com> 寄件日期: 2021年10月26日 上午 10:38 收件者: Bills, Jason M <jason.m.bills@linux.intel.com> 副本: openbmc <openbmc@lists.ozlabs.org> 主旨: Re: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually On Tue, Oct 26, 2021 at 5:09 AM Bills, Jason M <jason.m.bills@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://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-$ >, 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://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/src/sel_logger.cpp*L270__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWAPFsP5v$ . > > "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@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://urldefense.com/v3/__https://github.com/openbmc/phosphor-sel-logger/blob/master/meson.build*L31__;Iw!!HSntlCg!DmYViJwyTbSsZw5NvzcDb2b4At-l1AU-wcwYn0FkzpUrMoBY6yH3Wa8oWERbrnIZ$ -- BRs, Lei YU Legal Disclaimer : The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message! [-- Attachment #2: Type: text/html, Size: 8328 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually 2021-10-26 6:14 ` 回覆: " Chris Chen (TPI) @ 2021-10-26 6:24 ` Lei YU 2021-10-26 8:39 ` 回覆: " Chris Chen (TPI) 0 siblings, 1 reply; 6+ messages in thread From: Lei YU @ 2021-10-26 6:24 UTC (permalink / raw) To: Chris Chen (TPI); +Cc: Bills, Jason M, Lei Yu, openbmc On Tue, Oct 26, 2021 at 2:16 PM Chris Chen (TPI) <Chris.Chen3@flex.com> wrote: > > Hi Jason and Lei Yu, > > Thanks for your sharing. > > 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. > > 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? It depends on the config of ipmid. You may be using the dynamic sensor feature (FEATURE_DYNAMIC_SENSORS), which does not work with the above case. To make ipmid work with the logging entry -> SEL parsing, you need to use the static sensors defined by yaml config, and then the code will parse the logging entry into a SEL record. ^ permalink raw reply [flat|nested] 6+ messages in thread
* 回覆: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually 2021-10-26 6:24 ` Lei YU @ 2021-10-26 8:39 ` Chris Chen (TPI) 0 siblings, 0 replies; 6+ messages in thread From: Chris Chen (TPI) @ 2021-10-26 8:39 UTC (permalink / raw) To: Lei YU; +Cc: openbmc [-- Attachment #1: Type: text/plain, Size: 2200 bytes --] Hi Lei Yu, Understood. Thanks for your explanation. Regards, Chris Chen ________________________________ 寄件者: Lei YU <mine260309@gmail.com> 寄件日期: 2021年10月26日 下午 02:24 收件者: Chris Chen (TPI) <Chris.Chen3@flex.com> 副本: Lei Yu <yulei.sh@bytedance.com>; Bills, Jason M <jason.m.bills@linux.intel.com>; openbmc <openbmc@lists.ozlabs.org> 主旨: Re: [Phishing Risk] [External] Re: [phosphor-sel-logger] How to add a journal entry manually On Tue, Oct 26, 2021 at 2:16 PM Chris Chen (TPI) <Chris.Chen3@flex.com> wrote: > > Hi Jason and Lei Yu, > > Thanks for your sharing. > > 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. > > 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? It depends on the config of ipmid. You may be using the dynamic sensor feature (FEATURE_DYNAMIC_SENSORS), which does not work with the above case. To make ipmid work with the logging entry -> SEL parsing, you need to use the static sensors defined by yaml config, and then the code will parse the logging entry into a SEL record. Legal Disclaimer : The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message! [-- Attachment #2: Type: text/html, Size: 3821 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-10-26 8:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-25 11:02 [phosphor-sel-logger] How to add a journal entry manually Chris Chen (TPI) 2021-10-25 21:07 ` Bills, Jason M 2021-10-26 2:38 ` [Phishing Risk] [External] " Lei Yu 2021-10-26 6:14 ` 回覆: " Chris Chen (TPI) 2021-10-26 6:24 ` Lei YU 2021-10-26 8:39 ` 回覆: " Chris Chen (TPI)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).