phosphor-sel-logger
phosphor-sel-logger
Build Options
option | default | description | Macro |
---|---|---|---|
log-threshold | disable | Automatically log SEL records for threshold sensor events | SEL_LOGGER_MONITOR_THRESHOLD_EVENTS |
log-pulse | disable | Automatically log events to Redfish for pulse type assert-deassert sensor events | REDFISH_LOG_MONITOR_PULSE_EVENTS |
log-watchdog | disable | Automatically log SEL records for watchdog events | SEL_LOGGER_MONITOR_WATCHDOG_EVENTS |
log-alarm | disable | Monitor threshold alarm signals and log SEL records for threshold sensor events | SEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS |
log-host | disable | Automatically log SEL records for host error events | SEL_LOGGER_MONITOR_HOST_ERROR_EVENTS |
send-to-logger | disable | Automatically log events to Redfish for pulse type assert-deassert sensor events | SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
sel-delete | disable | Enables ability to delete SEL entries given a record ID | SEL_LOGGER_ENABLE_SEL_DELETE |
Output
Type | Name |
---|---|
exe | sel-logger |
.service | xyz.openbmc_project.Logging.IPMI.service |
DBus Provider
service:
- xyz.openbmc_project.Logging.IPMI #service
- /xyz/openbmc_project/Logging/IPMI: #path
- xyz.openbmc_project.Logging.IPMI: #interface
method:
- IpmiSelAdd:
- IpmiSelAddOem:
- Clear:
dep_options:
- send-to-logger: disable
- IpmiSelDelete:
dep_options:
- send-to-logger : disable
- sel-delete : enable
record id初始化
-
sel-delete is enabled
搜索/var/log/next_records,获取当前record id
如果该文件不存在则创建该文件 -
sel-delete is disabed
搜索/var/log目录下,ipmi_sel开头的文件,找到最后一条记录获取record id
IPMI SEL接口
增加SEL Log
Method | Desc |
---|---|
IpmiSelAdd | |
IpmiSelAddOem |
- send-to-logger is enabled
send to 'phosphor-logging' by dbus:
xyz.openbmc_project.Logging /xyz/openbmc_project/logging xyz.openbmc_project.Logging.Create Create
- send-to-logger is disabled
send to systemd directly by 'sd_journal_send'
删除SEL Log
Method | Desc |
---|---|
Clear | |
IpmiSelDelete |
- sel-delete is enabled
- 删除日志文件
- Reload rsyslog so it knows to start new log files
org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ReloadUnit rsyslog.service replace
- 重置/var/log/next_records
- sel-delete is disabed
- 删除日志文件
- Reload rsyslog so it knows to start new log files
org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ReloadUnit rsyslog.service replace
自动记录日志
通过监听DBus上相关事件,实现自动记录日志
log-threshold
type='signal', member='ThresholdAsserted'
log-pulse
type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Host'
log-watchdog
type='signal',interface='xyz.openbmc_project.Watchdog',member='Timeout'
log-alarm
type='signal',member='WarningLowAlarmAsserted'
type='signal',member='WarningLowAlarmDeasserted'
type='signal',member='WarningHighAlarmAsserted'
type='signal',member='WarningHighAlarmDeasserted'
type='signal',member='CriticalLowAlarmAsserted'
type='signal',member='CriticalLowAlarmDeasserted'
type='signal',member='CriticalHighAlarmAsserted'
type='signal',member='CriticalHighAlarmDeasserted'
log-host
type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',arg0namespace='xyz.openbmc_project.HostErrorMonitor.Processor.ThermalTrip
type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',arg0namespace='xyz.openbmc_project.HostErrorMonitor.Processor.IERR
https://github.com/pswarfound