blob: ac53c0e52d1b9585e7255d1045d2e961d0e7dda9 [file] [log] [blame]
Brad Bishop870c3fc2017-05-22 23:23:13 -04001# Example PDM configuration file.
Brad Bishop0e7df132017-05-23 17:58:12 -04002
3- name: example path group
4 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -06005 'A path group is a named collection of D-Bus object paths and associated
6 metadata. These collections serve only to be referenced by other
7 configuration directives.
Brad Bishop0e7df132017-05-23 17:58:12 -04008
Patrick Williams2b31c982022-12-08 06:12:49 -06009 The metadata element has different uses depending on the referencing
10 directive.
Brad Bishop0e7df132017-05-23 17:58:12 -040011
Patrick Williams2b31c982022-12-08 06:12:49 -060012 Within a single configuration file path group names must be unique. The
13 same name can appear in multiple configuration files; however, the
14 referencing directive will only search for the group in the same
15 configuration file.'
Brad Bishop0e7df132017-05-23 17:58:12 -040016 class: group
17 group: path
18 members:
Patrick Williams2b31c982022-12-08 06:12:49 -060019 - meta: PATH
20 path: /xyz/openbmc_project/testing/inst1
21 - meta: PATH
22 path: /xyz/openbmc_project/testing/inst2
23 - meta: PATH
24 path: /xyz/openbmc_project/testing/inst3
25 - meta: PATH
26 path: /xyz/openbmc_project/testing/inst4
Brad Bishope73b2c32017-05-23 18:01:54 -040027
28- name: example property group
29 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -060030 'Like path groups, a property group is a named collection of D-Bus
31 property names and associated metadata.
Brad Bishope73b2c32017-05-23 18:01:54 -040032
Patrick Williams2b31c982022-12-08 06:12:49 -060033 Properties in a group must all have the same D-Bus type signature and must
34 be explicitly declared.'
Brad Bishope73b2c32017-05-23 18:01:54 -040035 class: group
36 group: property
37 type: uint32
38 members:
Patrick Williams2b31c982022-12-08 06:12:49 -060039 - interface: xyz.openbmc_project.Sensor.Value
40 meta: PROPERTY
41 property: ValueA
42 - interface: xyz.openbmc_project.Sensor.Value
43 meta: PROPERTY
44 property: ValueB
Brad Bishop4b916f12017-05-23 18:06:38 -040045
46- name: example property watch
47 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -060048 'A property watch instructs PDM to maintain a cache of the state of the
49 specified properties on the specified D-Bus objects.
Brad Bishopfccdc392017-05-22 21:11:09 -040050
Patrick Williams2b31c982022-12-08 06:12:49 -060051 An optional set of filters can be applied to the specified properties,
52 where each property's cache is cleared when it fails to pass any one
53 filter. The property's cache is cleared so it will not have an affect on
54 any optional callback that may be triggered.
Matthew Barthae786ef2019-09-04 15:46:13 -050055
Patrick Williams2b31c982022-12-08 06:12:49 -060056 An optional callback can be triggered when property values change and
57 those values pass all filters that may be defined.
Lei YU98d64622022-05-24 19:11:23 +080058
Patrick Williams2b31c982022-12-08 06:12:49 -060059 By default the callback is called when the monitor starts. An optional
60 `ignore_start_callback` can be set to true so that the callback will not
61 be called when the monitor starts.'
Lei YU98d64622022-05-24 19:11:23 +080062
Brad Bishop4b916f12017-05-23 18:06:38 -040063 class: watch
64 watch: property
65 paths: example path group
66 properties: example property group
Brad Bishopfccdc392017-05-22 21:11:09 -040067 callback: example count condition
Matthew Barthae786ef2019-09-04 15:46:13 -050068 filters:
Patrick Williams2b31c982022-12-08 06:12:49 -060069 - op: ">="
70 bound: 0
71 - op: "<="
72 bound: 100
Lei YU98d64622022-05-24 19:11:23 +080073 ignore_start_callback: true
Brad Bishopc1283ae2017-05-20 21:42:38 -040074
75- name: example journal callback
76 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -060077 'Callbacks are actions PDM should take when instructed to do so.
Brad Bishopc1283ae2017-05-20 21:42:38 -040078
Patrick Williams2b31c982022-12-08 06:12:49 -060079 Some callback types refer to a group of paths and group of properties in a
80 similar fashion as the property watch directive.
Brad Bishopc1283ae2017-05-20 21:42:38 -040081
Patrick Williams2b31c982022-12-08 06:12:49 -060082 The journal callback logs the specified message to the systemd journal
83 with the specified severity.
Brad Bishopc1283ae2017-05-20 21:42:38 -040084
Patrick Williams2b31c982022-12-08 06:12:49 -060085 Additionally, the journal callback will add to the journal key value pair
86 metadata for each property in the specified property group with the key
87 being the property element metadata and the value being the property
88 value.'
Brad Bishopc1283ae2017-05-20 21:42:38 -040089 class: callback
90 callback: journal
91 paths: example path group
92 properties: example property group
93 severity: INFO
94 message: Hello world from PDM!
Brad Bishop49e66172017-05-23 19:16:21 -040095
Gunnar Millsacac6022017-08-14 16:24:55 -050096- name: example elog callback
97 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -060098 'Callbacks are actions PDM should take when instructed to do so.
Gunnar Millsacac6022017-08-14 16:24:55 -050099
Patrick Williams2b31c982022-12-08 06:12:49 -0600100 Some callback types refer to a group of paths and group of properties in a
101 similar fashion as the property watch directive.
Gunnar Millsacac6022017-08-14 16:24:55 -0500102
Patrick Williams2b31c982022-12-08 06:12:49 -0600103 The elog callback logs the elog and elog metadata.'
Gunnar Millsacac6022017-08-14 16:24:55 -0500104 class: callback
105 callback: elog
106 paths: example path group
107 properties: example property group
108 error: xyz::openbmc_project::Common::Error::InvalidArgument
109 metadata:
Patrick Williams2b31c982022-12-08 06:12:49 -0600110 - name: xyz::openbmc_project::Common::InvalidArgument::ARGUMENT_NAME
111 value: testing...
112 type: string
113 - name: xyz::openbmc_project::Common::InvalidArgument::ARGUMENT_VALUE
114 value: testing...
115 type: string
Gunnar Millsacac6022017-08-14 16:24:55 -0500116
Matt Spinler3c5318d2018-02-19 14:03:05 -0600117- name: example elog with metadata capture callback
118 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600119 'Callbacks are actions pdm should take when instructed to do so.
Matt Spinler3c5318d2018-02-19 14:03:05 -0600120
Patrick Williams2b31c982022-12-08 06:12:49 -0600121 This callback creates an elog, and it will capture the values of the
122 properties that passed its condition check in the metadata field (that
123 must be a string type) in the form:
Matt Spinler3c5318d2018-02-19 14:03:05 -0600124
Patrick Williams2b31c982022-12-08 06:12:49 -0600125 |path1:property1=value1|path2:property2=value2|
Matt Spinler3c5318d2018-02-19 14:03:05 -0600126
Patrick Williams2b31c982022-12-08 06:12:49 -0600127 Note that as this callback depends on the condition that called it to fill
128 in the result of its checks on each property, this callback should use the
129 same properties and paths keywords as the condition that calls it.
Matt Spinler3c5318d2018-02-19 14:03:05 -0600130
Patrick Williams2b31c982022-12-08 06:12:49 -0600131 Currently an error log with only 1 metadata entry of type string is
132 supported.'
Matt Spinler3c5318d2018-02-19 14:03:05 -0600133
134 class: callback
135 callback: elog_with_metadata
136 paths: example path group
137 properties: example property group
138 error: xyz::openbmc_project::Common::Callout::Error::Inventory
139 metadata: xyz::openbmc_project::Common::Callout::Inventory::CALLOUT_INVENTORY_PATH
140
Ratan Gupta40e0db42017-10-13 20:20:43 +0530141- name: example event callback
142 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600143 'Callbacks are actions PDM should take when instructed to do so.
Ratan Gupta40e0db42017-10-13 20:20:43 +0530144
Patrick Williams2b31c982022-12-08 06:12:49 -0600145 Some callback types refer to a group of paths and group of properties in a
146 similar fashion as the property watch directive.
Ratan Gupta40e0db42017-10-13 20:20:43 +0530147
Patrick Williams2b31c982022-12-08 06:12:49 -0600148 The event callback creates the event D-Bus object with the given name and
149 the event message. eg /xyz/openbmc_project/events/test/<id>'
Ratan Gupta40e0db42017-10-13 20:20:43 +0530150 class: callback
151 callback: event
152 paths: example path group
153 properties: example property group
154 eventName: test
155 eventMessage: "Test configuration changed."
156
Brad Bishop0df00be2017-05-25 23:38:37 -0400157- name: example method callback
158 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600159 'The method callback invokes the specified D-Bus method.'
Brad Bishop0df00be2017-05-25 23:38:37 -0400160 class: callback
161 callback: method
162 service: org.freedesktop.systemd1
163 path: /org/freedesktop/systemd1
164 interface: org.freedesktop.systemd1.Manager
165 method: StartUnit
166 args:
Patrick Williams2b31c982022-12-08 06:12:49 -0600167 - value: foo.unit
168 type: string
169 - value: replace
170 type: string
Brad Bishop0df00be2017-05-25 23:38:37 -0400171
Matt Spinlerf7a6a462017-11-01 10:51:19 -0500172- name: example resolve callouts callback
173 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600174 'The resolve callout callback resolves all error log entries that are
175 associated with the inventory path specified by setting the Resolved
176 property in the entries to true.
Matt Spinlerf7a6a462017-11-01 10:51:19 -0500177
Patrick Williams2b31c982022-12-08 06:12:49 -0600178 A use case could be to watch the Present property on the inventory item
179 and resolve all errors for it when a new one is plugged in and the
180 property changes to true.'
Matt Spinlerf7a6a462017-11-01 10:51:19 -0500181
182 class: callback
183 callback: resolve callout
184 paths: example path group
185 properties: example property group
186 callout: /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
187
Brad Bishop49e66172017-05-23 19:16:21 -0400188- name: example callback group
189 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600190 'Callbacks groups are simply named collections of other callbacks.
191 Configuration file directives can only refer to a single callback. Through
192 use of a group, these configuration file directives can refer to more than
193 one callback.
Brad Bishop49e66172017-05-23 19:16:21 -0400194
Patrick Williams2b31c982022-12-08 06:12:49 -0600195 For example for a given event, one may wish to trace multiple messages to
196 the systemd journal. The journal callback does not support tracing
197 multiple messages. To do that, define a callback group composed of
198 multiple journal callbacks.'
Brad Bishop49e66172017-05-23 19:16:21 -0400199
Brad Bishop49e66172017-05-23 19:16:21 -0400200 class: callback
201 callback: group
202 members:
Patrick Williams2b31c982022-12-08 06:12:49 -0600203 - example journal callback
204 - example deferred condition
205 - example elog callback
Brad Bishop4041d722017-05-21 10:06:07 -0400206
207- name: example count condition
208 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600209 'Conditions or conditional callbacks apply a test prior to invoking the
210 callback function.
Brad Bishop4041d722017-05-21 10:06:07 -0400211
Patrick Williams2b31c982022-12-08 06:12:49 -0600212 All conditional callbacks must specify the callback to issue if the
213 condition evaluates.
Brad Bishop4041d722017-05-21 10:06:07 -0400214
Patrick Williams2b31c982022-12-08 06:12:49 -0600215 The count condition applies the op comparison operator to the value of
216 each property in the specified groups. It then counts the number of
217 properties that pass the comparison, and applies another comparison on the
218 result against the specified bound.
Brad Bishop4041d722017-05-21 10:06:07 -0400219
Patrick Williams2b31c982022-12-08 06:12:49 -0600220 For example, a callback that requires at least three temperature sensors
221 in the group to be higher than 115 degrees might use a count condition
222 with an op of >, a count op of >=, a bound of 115, and a countbound of 3.
Matt Spinlerc458dee2018-02-19 13:09:10 -0600223
Patrick Williams2b31c982022-12-08 06:12:49 -0600224 The optional oneshot parameter defaults to false. If it is specified and
225 set to true, then the callback will only be called once for as long as the
226 condition is repeatedly passing. The condition needs to fail at least
227 once to rearm the callback.'
Brad Bishop4041d722017-05-21 10:06:07 -0400228
229 class: condition
230 condition: count
231 paths: example path group
232 properties: example property group
233 callback: example callback group
Patrick Williams2b31c982022-12-08 06:12:49 -0600234 countop: ">="
Brad Bishop4041d722017-05-21 10:06:07 -0400235 countbound: 3
Patrick Williams2b31c982022-12-08 06:12:49 -0600236 op: ">="
Brad Bishop4041d722017-05-21 10:06:07 -0400237 bound: 115
Matt Spinlerc458dee2018-02-19 13:09:10 -0600238 oneshot: true
Brad Bishop3539db62017-05-30 14:21:12 -0400239
240- name: example deferred condition
241 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600242 'Deferred conditions operate in the same fashion as conditional callbacks
243 with the added behavior that when the condition is tested and is met,
244 invocation of the callback is deferred by the interval specified.
Brad Bishop3539db62017-05-30 14:21:12 -0400245
Patrick Williams2b31c982022-12-08 06:12:49 -0600246 When the configured time has elapsed, if the condition has not been
247 reevaluated the callback is invoked.
Brad Bishop3539db62017-05-30 14:21:12 -0400248
Patrick Williams2b31c982022-12-08 06:12:49 -0600249 Any condition type can be deferred in this way by setting the defer
250 attribute.'
Brad Bishop3539db62017-05-30 14:21:12 -0400251
252 class: condition
253 condition: count
254 paths: example path group
255 properties: example property group
256 defer: 1000us
257 callback: example callback group
Patrick Williams2b31c982022-12-08 06:12:49 -0600258 countop: ">="
Brad Bishop3539db62017-05-30 14:21:12 -0400259 countbound: 3
Patrick Williams2b31c982022-12-08 06:12:49 -0600260 op: ">="
Brad Bishop3539db62017-05-30 14:21:12 -0400261 bound: 115
Marri Devender Rao80c70612018-04-12 09:22:55 -0500262
263- name: errorlog path group
264 class: group
265 group: path
266 members:
Patrick Williams2b31c982022-12-08 06:12:49 -0600267 - meta: PATH
268 path: /xyz/openbmc_project/logging
Marri Devender Rao80c70612018-04-12 09:22:55 -0500269
270- name: pathwatch errorlog
271 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600272 'A pathwatch watches on the specified object path goup. pathcallback are
273 actions PDM should take when instructed to do so.'
Marri Devender Rao80c70612018-04-12 09:22:55 -0500274
275 class: pathwatch
276 pathwatch: path
277 paths: errorlog path group
278 pathcallback: create errorlog event
279
280- name: create errorlog event
281 description: >
Patrick Williams2b31c982022-12-08 06:12:49 -0600282 'eventType specifies the type of the SNMP notification.'
Marri Devender Rao80c70612018-04-12 09:22:55 -0500283 class: pathcallback
284 pathcallback: eventpath
285 paths: errorlog path group
286 eventType: ErrorTrap