xref: /netbsd-src/usr.sbin/envstat/envsys.conf.5 (revision 4b71a66d0f279143147d63ebfcfd8a59499a3684)
1.\" $NetBSD: envsys.conf.5,v 1.7 2008/04/26 02:56:57 xtraeme 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 critical-max = 70C;
169.Pp
170Sets a critical max limit property in a sensor.
171Note that in this example, we are specifying the
172.Ql C
173keyword at the end; that means that this will only be valid for
174.Em temperature
175sensors and that the value is specified as degrees
176.Em Celsius .
177If degrees Fahrenheit are wanted, just change use the letter
178.Em F ,
179like:
180.Bd -literal -offset indent
181critical-max = 140F;
182.Ed
183.Pp
184To know sensor type, you have to look at the
185.Em type
186object in the XML property list.
187Remember: the XML property list has
188all the information that the application uses to print the values!
189.Pp
190Other sensors that are not of
191.Em temperature
192type must not include the final character for the unit.
193A dot is allowed in the value, if it corresponds to the
194range that the sensor is reporting.
195When the limit has been reached in the sensor, a
196.Em critical-over
197event will be sent to the
198.Xr powerd 8
199daemon (if running) and will execute the block for this event in
200the appropriate
201.Pa /etc/powerd/scripts/sensor_foo
202script (depending on the sensor's type).
203.Pp
204Please note that this property cannot be set in battery sensors
205(those that have the
206.Em want-percentage
207object in their dictionary).
208This rule applies for the
209.Ql critical-min
210property too.
211.Pp
212If this property is set, its value will be shown in the
213.Xr envstat 8
214display output with a column named
215.Ar CritMax .
216.It critical-min = 1.230;
217.Pp
218Sets a critical min limit property in a sensor.
219The rules for
220.Em critical-max
221and
222.Em critical-min
223are the same.
224When the limit has been reached in the sensor, a
225.Em critical-under
226event will be sent to the
227.Xr powerd 8
228daemon (if running) and will execute the block for this event in
229the appropriate
230.Pa /etc/powerd/scripts/sensor_foo
231script (depending on the sensor's type).
232.Pp
233If this property is set, its value will be shown in the
234.Xr envstat 8
235display output with a column named
236.Ar CritMin .
237.It description = string
238.Pp
239Sets a new description in a sensor.
240You can set this property in
241all sensors, except that you won't be able to set a description
242that is currently used for the specified device.
243.It rfact = 56000
244.Pp
245Sets a new resistor factor property in a sensor.
246This property is only allowed in
247.Em Voltage
248sensors and
249.Em only
250if the driver has enabled the appropriate flag for the mentioned
251sensor.
252The resistor factor may be used to change the behavior
253of the value returned by the driver.
254.Pp
255If a sensor supports this, the
256.Em allow-rfact
257object appears enabled (true) in the dictionary.
258.El
259.Pp
260The following properties are available for device blocks:
261.Bl -tag -width ident
262.It refresh-timeout = 10s
263.Pp
264This property sets the refresh timeout value in a driver, and will be used
265to refresh data and check for critical conditions any time the timeout
266is met. The value may be specified in seconds, minutes or hours. To specify
267the value in seconds, the
268.Em s
269character must be appended last, if minutes is desired, a
270.Em m
271and a
272.Em h
273for hours. For example
274.Em 10s
275for 10 seconds or
276.Em 1h
277for one hour.
278.El
279.Sh FILES
280.Bl -tag -width /etc/envsys.conf -compact
281.It Pa /etc/envsys.conf
282Default configuration file.
283.El
284.Sh SEE ALSO
285.Xr proplib 3 ,
286.Xr envstat 8 ,
287.Xr powerd 8
288.Sh HISTORY
289The
290.Nm
291configuration file first appeared in
292.Nx 5.0 .
293