using phosphor-dbus-monitor
Wim Vervoorn
wvervoorn at eltan.com
Wed Apr 10 00:22:40 AEST 2019
Hello Matt,
In this case it's just trying to make sure the logging is always triggered. It the condition is to log if the voltage on this sensor is above some very low value which I know it will be. I created this in the assumption it would always trigger.
The real thing I am trying to do is to trigger if a few sensors are reporting critical values. I included this here:
- name: voltage sensor path group
class: group
group: path
members:
- meta: SENSOR
path: /xyz/openbmc_project/sensors/voltage/PVNN_PCH_AUX
- meta: SENSOR
path: /xyz/openbmc_project/sensors/voltage/P3VBAT
- name: sensor critical property group
description: >
'sensor state.'
class: group
group: property
type: boolean
members:
- interface: xyz.openbmc_project.Sensors.Threshold.Critical
meta: PROPERTY
property: CriticalAlarmHigh
- interface: xyz.openbmc_project.Sensors.Threshold.Critical
meta: PROPERTY
property: CriticalAlarmLow
- name: watch sensor state
description: >
'Trigger logic on sensor state.'
class: watch
watch: property
paths: voltage sensor path group
properties: sensor critical property group
callback: sensor count condition
- name: sensor count condition
description: >
'check critical condition of the sensors.'
class: condition
condition: count
paths: voltage sensor path group
properties: sensor critical property group
callback: log and shutdown
countop: '>'
countbound: 0
op: '=='
bound: true
- name: log and shutdown
description: >
'Shut the system down and log an event.'
class: callback
callback: group
members:
- example journal callback
- sensor critical error
- create shutdown error
- name: example journal callback
description: >
' example journal callback'
class: callback
callback: journal
paths: voltage sensor path group
properties: sensor critical property group
severity: INFO
message: Hello world from PDM!
- name: sensor critical error
class: callback
callback: elog_with_metadata
paths: voltage sensor path group
properties: sensor critical property group
error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
- name: create shutdown error
description: >
'Create a SystemShutdown Error log.'
class: callback
callback: elog
paths: voltage sensor path group
properties: sensor critical property group
error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
metadata:
- name: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
value: testing...
type: string
-----Original Message-----
From: Matthew Barth [mailto:msbarth at linux.ibm.com]
Sent: Tuesday, April 9, 2019 4:12 PM
To: Matt Spinler <mspinler at linux.ibm.com>; Wim Vervoorn <wvervoorn at eltan.com>; Lei YU <mine260309 at gmail.com>
Cc: openbmc at lists.ozlabs.org
Subject: Re: using phosphor-dbus-monitor
On 4/9/19 8:50 AM, Matt Spinler wrote:
> Hi Wim,
>
> If you could post your YAML somewhere, I could take a look for any
> obvious problems.
If you could also provide a little more details on the error your attempting to log would be helpful (i.e. is there a dbus interface?).
>
> On 4/9/2019 2:23 AM, Wim Vervoorn wrote:
>> Hello Lei,
>>
>> Thanks for your response. I know this example too and it helps a bit
>> but it doesn’t really clarify all issues.
>>
>> As you've worked with this as well. Do you understand the meta item?
>> The example indicates it has different meaning but doesn't provide
>> any pointers to what those meanings are. Have you been able to find out?
What meta item are you referring to?
>>
>> Best Regards,
>> Wim Vervoorn
>>
>> -----Original Message-----
>> From: Lei YU [mailto:mine260309 at gmail.com]
>> Sent: Tuesday, April 9, 2019 5:44 AM
>> To: Wim Vervoorn <wvervoorn at eltan.com>; Matthew Barth
>> <msbarth at linux.ibm.com>
>> Cc: openbmc at lists.ozlabs.org
>> Subject: Re: using phosphor-dbus-monitor
>>
>>> I am trying to use phosphor-dbus-monitor to create logging of sensor
>>> exceptions like a Critical state on a specific sensor.
>>> I am able to create a solution with a building yaml but at the end
>>> it doesn’t deliver me the desired result.
>>> As there are very limited examples (on a few in the witherspoon) it
>>> is very hard to figure out where the mistake is.
>> There is an example yaml config in the repo:
>> https://github.com/openbmc/phosphor-dbus-monitor/blob/master/src/exam
>> ple/example.yaml
>>
>>
>> And I have the same feeling that it's hard to know what's wrong if
>> something is wrong.ei
>>
>>> Are there any tools that can be used to make this easier?
>> @Matthew Barth Could you kindly help to add some doc/tool to make it
>> easier to use?
Originally, the example yaml was meant to be the document which I understand is probably not the greatest form when it comes to this.
Unfortunately enhancing the documentation would be a low priority at this time but feel free to create/update the documentation from your findings and push them up for review if you'd like.
>>
>>> Additionally is this the correct method to achieve this goal or
>>> should I use something else to define conditions for logging?
>> I think so. This repo is intended to watch the dbus and do stuff as
>> yaml config.
Correct. This repo was intended to perform error logging and/or system level actions, such as a shutdown, based on object properties on dbus.
>>
>>
More information about the openbmc
mailing list