xref: /netbsd-src/usr.sbin/envstat/envsys.conf.5 (revision 274254cdae52594c1aa480a736aef78313d15c9c)
1.\" $NetBSD: envsys.conf.5,v 1.11 2008/09/23 21:50:41 reed Exp $
2.\"
3.\" -
4.\" Copyright (c) 2007, 2008 Juan Romero Pardines.
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\"
28.Dd April 26, 2008
29.Dt ENVSYS.CONF 5
30.Os
31.Sh NAME
32.Nm envsys.conf
33.Nd Configuration file for the envsys framework
34.Sh SYNOPSIS
35.Nm envstat
36.Op Fl S
37.Op Fl c Ar /etc/envsys.conf
38.Sh DESCRIPTION
39The
40.Nm
41file configures all the features provided by the
42.Xr envsys 4
43framework.
44It consists of a series of device and sensor blocks.
45Each sensor block defines a group of
46.Em properties .
47The file format is free-form: new line markers and indentation are
48ignored.
49Comments start with a
50.Sq #
51sign and extend until the end of line.
52.Pp
53A
54.Em property
55is like a variable assignment.
56It has a name, which goes to the left of the equal sign, and a value,
57which goes to the right.
58The assignment ends with a semicolon.
59It looks like:
60.Pp
61.Dl name = value;
62.Pp
63There is no difference between string or integer values when defining them.
64The value must be surrounded by double quotes if it contains whitespace.
65.Pp
66There can be multiple groups of devices and multiple groups of sensors
67in the configuration file.
68.Pp
69A device block consists of one or more sensor blocks and one or more global
70properties. It has the following syntax:
71.Bd -literal -offset indent
72	device_name {
73		prop = value;
74		...
75        	sensor0 {
76			prop = value;
77        		...
78		}
79		...
80		sensorN {
81			prop = value;
82			...
83		}
84	}
85	...
86.Ed
87.Pp
88Device names are those shown by the
89.Ql envstat -D
90command; sensor blocks are named by the index position in which they are shown.
91.Pp
92For example, if we have the following output from the
93.Xr envstat 8
94command:
95.Bd -literal -offset indent
96  CPU Temperature:     32.000 degC
97   MB Temperature:     37.000 degC
98    Vcore Voltage:      1.232 V
99     +3.3 Voltage:      3.248 V
100       +5 Voltage:      4.992 V
101      +12 Voltage:     11.985 V
102    CPU FAN Speed:       1250 RPM
103.Ed
104.Pp
105.Ql sensor0
106corresponds to the
107.Em CPU Temperature
108sensor and
109.Ql sensor6
110corresponds to the
111.Em CPU FAN Speed
112sensor.
113.Pp
114There is another way that will give you the correct index
115sensor; the
116.Ql envstat -x
117command will print the raw XML property list.
118You only have to find the
119.Em index
120object in the appropriate dictionary.
121The object will be shown as:
122.Bd -literal -offset indent
123	\*[Lt]key\*[Gt]index\*[Lt]/key\*[Gt]
124	\*[Lt]string\*[Gt]sensor2\*[Lt]/string\*[Gt]
125.Ed
126.Pp
127Invalid sensors and devices will be detected by the
128.Xr envstat 8
129parser and will be reported as errors.
130.Pp
131The following properties are provided for sensor blocks (please note that
132not all properties apply to all type of sensors):
133.Bl -tag -width ident
134.It critical-capacity = 10;
135.Pp
136Sets a critical capacity limit property of 10
137percent in a battery sensor.
138Battery sensors are those that report a percentage from the
139.Xr envstat 8
140output.
141.Pp
142It is possible to find out if the sensor accepts this property
143by running
144.Ql envstat -x
145and looking if the
146.Em want-percentage
147object is defined as
148.Em true
149on its dictionary.
150For example:
151.Bd -literal -offset indent
152	\*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt]
153	\*[Lt]true/\*[Gt]
154.Ed
155.Pp
156Only a value between 0 and 100 is allowed.
157When the limit is reached in the sensor, a
158.Em user-capacity
159event will be sent to the
160.Xr powerd 8
161daemon (if running) and will execute the block for this event in
162.Pa /etc/powerd/scripts/sensor_battery .
163.Pp
164If this property is set, its value will be shown in the
165.Xr envstat 8
166display output with a column named
167.Ar CritCap .
168.It warning-capacity = 20;
169.Pp
170Sets a warning capacity limit property of 20
171percent in a battery sensor.
172Battery sensors are those that report a percentage from the
173.Xr envstat 8
174output.
175.Pp
176It is possible to find out if the sensor accepts this property
177by running
178.Ql envstat -x
179and looking if the
180.Em want-percentage
181object is defined as
182.Em true
183on its dictionary.
184For example:
185.Bd -literal -offset indent
186	\*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt]
187	\*[Lt]true/\*[Gt]
188.Ed
189.Pp
190Only a value between 0 and 100 is allowed.
191When the limit is reached in the sensor, a
192.Em user-warn-capacity
193event will be sent to the
194.Xr powerd 8
195daemon (if running) and will execute the block for this event in
196.Pa /etc/powerd/scripts/sensor_battery .
197.Pp
198If this property is set, its value will be shown in the
199.Xr envstat 8
200display output with a column named
201.Ar WarnCap
202when the
203.Fl -W
204option is specified.
205.It critical-max = 70C;
206.Pp
207Sets a critical maximum limit property in a sensor.
208Note that in this example, we are specifying the
209.Ql C
210keyword at the end; that means that this will only be valid for
211.Em temperature
212sensors and that the value is specified as degrees
213.Em Celsius .
214If degrees Fahrenheit are wanted, just change use the letter
215.Em F ,
216like:
217.Bd -literal -offset indent
218critical-max = 140F;
219.Ed
220.Pp
221To know sensor type, you have to look at the
222.Em type
223object in the XML property list.
224Remember: the XML property list has
225all the information that the application uses to print the values!
226.Pp
227Other sensors that are not of
228.Em temperature
229type must not include the final character for the unit.
230A dot is allowed in the value, if it corresponds to the
231range that the sensor is reporting.
232When the limit has been reached in the sensor, a
233.Em critical-over
234event will be sent to the
235.Xr powerd 8
236daemon (if running) and will execute the block for this event in
237the appropriate
238.Pa /etc/powerd/scripts/sensor_foo
239script (depending on the sensor's type).
240.Pp
241Please note that this property cannot be set in battery sensors
242(those that have the
243.Em want-percentage
244object in their dictionary).
245This rule applies for the
246.Ql critical-min ,
247.Ql warning-max ,
248and
249.Ql warning-min
250properties too.
251.Pp
252If this property is set, its value will be shown in the
253.Xr envstat 8
254display output with a column named
255.Ar CritMax
256unless the
257.Fl W
258option is specified.
259.It critical-min = 1.230;
260.Pp
261Sets a critical minimum limit property in a sensor.
262The rules for
263.Em critical-max ,
264.Em critical-min ,
265.Em warning-max ,
266and
267.Em warning-min
268are the same.
269When the limit has been reached in the sensor, a
270.Em critical-under
271event will be sent to the
272.Xr powerd 8
273daemon (if running) and will execute the block for this event in
274the appropriate
275.Pa /etc/powerd/scripts/sensor_foo
276script (depending on the sensor's type).
277.Pp
278If this property is set, its value will be shown in the
279.Xr envstat 8
280display output with a column named
281.Ar CritMin .
282.It warning-max = 70C;
283.Pp
284Sets a warning maximum limit property in a sensor.
285The rules for
286.Em critical-max ,
287.Em critical-min ,
288.Em warning-max ,
289and
290.Em warning-min
291are the same.
292When the limit has been reached in the sensor, a
293.Em warning-over
294event will be sent to the
295.Xr powerd 8
296daemon (if running) and will execute the block for this event in
297the appropriate
298.Pa /etc/powerd/scripts/sensor_foo
299script (depending on the sensor's type).
300.Pp
301Please note that this property cannot be set in battery sensors
302(those that have the
303.Em want-percentage
304object in their dictionary).
305This rule applies for the
306.Ql warning-min
307property too.
308.Pp
309If this property is set, its value will be shown in the
310.Xr envstat 8
311display output with a column named
312.Ar WarnMax
313if the
314.Fl W
315flag is specified.
316.It warning-min = 1.230;
317.Pp
318Sets a critical minimum limit property in a sensor.
319The rules for
320.Em critical-max ,
321.Em critical-min ,
322.Em warning-max ,
323and
324.Em warning-min
325are the same.
326When the limit has been reached in the sensor, a
327.Em warning-under
328event will be sent to the
329.Xr powerd 8
330daemon (if running) and will execute the block for this event in
331the appropriate
332.Pa /etc/powerd/scripts/sensor_foo
333script (depending on the sensor's type).
334.Pp
335If this property is set, its value will be shown in the
336.Xr envstat 8
337display output with a column named
338.Ar WarnMin
339if the
340.Fl W
341option is specified.
342.It description = string
343.Pp
344Sets a new description in a sensor.
345You can set this property in
346all sensors, except that you won't be able to set a description
347that is currently used for the specified device.
348.It rfact = 56000
349.Pp
350Sets a new resistor factor property in a sensor.
351This property is only allowed in
352.Em Voltage
353sensors and
354.Em only
355if the driver has enabled the appropriate flag for the mentioned
356sensor.
357The resistor factor may be used to change the behavior
358of the value returned by the driver.
359.Pp
360If a sensor supports this, the
361.Em allow-rfact
362object appears enabled (true) in the dictionary.
363.El
364.Pp
365The following properties are available for device blocks:
366.Bl -tag -width ident
367.It refresh-timeout = 10s
368.Pp
369This property sets the refresh timeout value in a driver, and will be used
370to refresh data and check for critical conditions any time the timeout
371is met. The value may be specified in seconds, minutes or hours. To specify
372the value in seconds, the
373.Em s
374character must be appended last, if minutes is desired, a
375.Em m
376and a
377.Em h
378for hours. For example
379.Em 10s
380for 10 seconds or
381.Em 1h
382for one hour.
383.El
384.Sh FILES
385.Bl -tag -width /etc/envsys.conf -compact
386.It Pa /etc/envsys.conf
387Default configuration file.
388.El
389.Sh SEE ALSO
390.Xr proplib 3 ,
391.Xr envstat 8 ,
392.Xr powerd 8
393.Sh HISTORY
394The
395.Nm
396configuration file first appeared in
397.Nx 5.0 .
398