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