1.\" $NetBSD: envsys.conf.5,v 1.5 2007/10/25 23:14:41 wiz 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 October 7, 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. 70It has the following syntax: 71.Bd -literal -offset indent 72 device_name { 73 sensor0 { 74 prop = value; 75 ... 76 } 77 ... 78 sensorN { 79 prop = value; 80 ... 81 } 82 } 83 ... 84.Ed 85.Pp 86Device names are those shown by the 87.Ql envstat -D 88command; sensor blocks are named by the index position in which they are shown. 89.Pp 90For example, if we have the following output from the 91.Xr envstat 8 92command: 93.Bd -literal -offset indent 94 CPU Temperature: 32.000 degC 95 MB Temperature: 37.000 degC 96 Vcore Voltage: 1.232 V 97 +3.3 Voltage: 3.248 V 98 +5 Voltage: 4.992 V 99 +12 Voltage: 11.985 V 100 CPU FAN Speed: 1250 RPM 101.Ed 102.Pp 103.Ql sensor0 104corresponds to the 105.Em CPU Temperature 106sensor and 107.Ql sensor6 108corresponds to the 109.Em CPU FAN Speed 110sensor. 111.Pp 112There is another way that will give you the correct index 113sensor; the 114.Ql envstat -x 115command will print the raw XML property list. 116You only have to find the 117.Em index 118object in the appropriate dictionary. 119The object will be shown as: 120.Bd -literal -offset indent 121 \*[Lt]key\*[Gt]index\*[Lt]/key\*[Gt] 122 \*[Lt]string\*[Gt]sensor2\*[Lt]/string\*[Gt] 123.Ed 124.Pp 125Invalid sensors and devices will be detected by the 126.Xr envstat 8 127parser and will be reported as errors. 128.Pp 129The following properties are provided (please note that not all properties 130apply to all type of sensors): 131.Bl -tag -width ident 132.It critical-capacity = 10; 133.Pp 134Sets a critical capacity limit property of 10 135percent in a battery sensor. 136Battery sensors are those that report a percentage from the 137.Xr envstat 8 138output. 139.Pp 140It is possible to find out if the sensor accepts this property 141by running 142.Ql envstat -x 143and looking if the 144.Em want-percentage 145object is defined as 146.Em true 147on its dictionary. 148For example: 149.Bd -literal -offset indent 150 \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] 151 \*[Lt]true/\*[Gt] 152.Ed 153.Pp 154Only a value between 0 and 100 is allowed. 155When the limit is reached in the sensor, a 156.Em user-capacity 157event will be sent to the 158.Xr powerd 8 159daemon (if running) and will execute the block for this event in 160.Pa /etc/powerd/scripts/sensor_battery . 161.It critical-max = 70C; 162.Pp 163Sets a critical max limit property in a sensor. 164Note that in this example, we are specifying the 165.Ql C 166keyword at the end; that means that this will only be valid for 167.Em temperature 168sensors and that the value is specified as degrees 169.Em Celsius . 170If degrees Fahrenheit are wanted, just change use the letter 171.Em F , 172like: 173.Bd -literal -offset indent 174critical-max = 140F; 175.Ed 176.Pp 177To know sensor type, you have to look at the 178.Em type 179object in the XML property list. 180Remember: the XML property list has 181all the information that the application uses to print the values! 182.Pp 183Other sensors that are not of 184.Em temperature 185type must not include the final character for the unit. 186A dot is allowed in the value, if it corresponds to the 187range that the sensor is reporting. 188When the limit has been reached in the sensor, a 189.Em critical-over 190event will be sent to the 191.Xr powerd 8 192daemon (if running) and will execute the block for this event in 193the appropriate 194.Pa /etc/powerd/scripts/sensor_foo 195script (depending on the sensor's type). 196.Pp 197Please note that this property cannot be set in battery sensors 198(those that have the 199.Em want-percentage 200object in their dictionary). 201This rule applies for the 202.Ql critical-min 203property too. 204.It critical-min = 1.230; 205.Pp 206Sets a critical min limit property in a sensor. 207The rules for 208.Em critical-max 209and 210.Em critical-min 211are the same. 212When the limit has been reached in the sensor, a 213.Em critical-under 214event will be sent to the 215.Xr powerd 8 216daemon (if running) and will execute the block for this event in 217the appropriate 218.Pa /etc/powerd/scripts/sensor_foo 219script (depending on the sensor's type). 220.It description = string 221.Pp 222Sets a new description in a sensor. 223You can set this property in 224all sensors, except that you won't be able to set a description 225that is currently used for the specified device. 226.It rfact = 56000; 227.Pp 228Sets a new resistor factor property in a sensor. 229This property is only allowed in 230.Em Voltage 231sensors and 232.Em only 233if the driver has enabled the appropriate flag for the mentioned 234sensor. 235The resistor factor may be used to change the behavior 236of the value returned by the driver. 237.Pp 238If a sensor supports this, the 239.Em allow-rfact 240object appears enabled (true) in the dictionary. 241.El 242.Sh FILES 243.Bl -tag -width /etc/envsys.conf -compact 244.It Pa /etc/envsys.conf 245Default configuration file. 246.El 247.Sh SEE ALSO 248.Xr proplib 3 , 249.Xr envstat 8 , 250.Xr powerd 8 251.Sh HISTORY 252The 253.Nm 254configuration file first appeared in 255.Nx 5.0 . 256