1.\" $NetBSD: envsys.conf.5,v 1.13 2010/02/15 23:04:11 pgoyette 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 February 15, 2010 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. 71It has the following syntax: 72.Bd -literal -offset indent 73 device_name { 74 prop = value; 75 ... 76 sensor0 { 77 prop = value; 78 ... 79 } 80 ... 81 sensorN { 82 prop = value; 83 ... 84 } 85 } 86 ... 87.Ed 88.Pp 89Device names are those shown by the 90.Ql envstat -D 91command; sensor blocks are named by the index position in which they are shown. 92.Pp 93For example, if we have the following output from the 94.Xr envstat 8 95command: 96.Bd -literal -offset indent 97 CPU Temperature: 32.000 degC 98 MB Temperature: 37.000 degC 99 Vcore Voltage: 1.232 V 100 +3.3 Voltage: 3.248 V 101 +5 Voltage: 4.992 V 102 +12 Voltage: 11.985 V 103 CPU FAN Speed: 1250 RPM 104.Ed 105.Pp 106.Ql sensor0 107corresponds to the 108.Em CPU Temperature 109sensor and 110.Ql sensor6 111corresponds to the 112.Em CPU FAN Speed 113sensor. 114.Pp 115There is another way that will give you the correct index 116sensor; the 117.Ql envstat -x 118command will print the raw XML property list. 119You only have to find the 120.Em index 121object in the appropriate dictionary. 122The object will be shown as: 123.Bd -literal -offset indent 124 \*[Lt]key\*[Gt]index\*[Lt]/key\*[Gt] 125 \*[Lt]string\*[Gt]sensor2\*[Lt]/string\*[Gt] 126.Ed 127.Pp 128Invalid sensors and devices will be detected by the 129.Xr envstat 8 130parser and will be reported as errors. 131.Pp 132The following properties are provided for sensor blocks (please note that 133not all properties apply to all type of sensors): 134.Bl -tag -width ident 135.It critical-capacity = 10; 136.Pp 137Sets a critical capacity limit property of 10 138percent in a battery sensor. 139Battery sensors are those that report a percentage from the 140.Xr envstat 8 141output. 142.Pp 143It is possible to find out if the sensor accepts this property 144by running 145.Ql envstat -x 146and looking if the 147.Em want-percentage 148object is defined as 149.Em true 150on its dictionary. 151For example: 152.Bd -literal -offset indent 153 \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] 154 \*[Lt]true/\*[Gt] 155.Ed 156.Pp 157Only a value between 0 and 100 is allowed. 158When the limit is reached in the sensor, a 159.Em critical-capacity 160event will be sent to the 161.Xr powerd 8 162daemon (if running) and will execute the block for this event in 163.Pa /etc/powerd/scripts/sensor_battery . 164.Pp 165If this property is set, its value will be shown in the 166.Xr envstat 8 167display output with a column named 168.Ar CritMin . 169.It warning-capacity = 20; 170.Pp 171Sets a warning capacity limit property of 20 172percent in a battery sensor. 173Battery sensors are those that report a percentage from the 174.Xr envstat 8 175output. 176.Pp 177It is possible to find out if the sensor accepts this property 178by running 179.Ql envstat -x 180and looking if the 181.Em want-percentage 182object is defined as 183.Em true 184on its dictionary. 185For example: 186.Bd -literal -offset indent 187 \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] 188 \*[Lt]true/\*[Gt] 189.Ed 190.Pp 191Only a value between 0 and 100 is allowed. 192When the limit is reached in the sensor, a 193.Em warning-capacity 194event will be sent to the 195.Xr powerd 8 196daemon (if running) and will execute the block for this event in 197.Pa /etc/powerd/scripts/sensor_battery . 198.Pp 199If this property is set, its value will be shown in the 200.Xr envstat 8 201display output with a column named 202.Ar WarnMin . 203.It high-capacity = 90; 204.Pp 205Sets a high capacity limit property of 90 206percent in a battery sensor. 207Battery sensors are those that report a percentage from the 208.Xr envstat 8 209output. 210.Pp 211It is possible to find out if the sensor accepts this property 212by running 213.Ql envstat -x 214and looking if the 215.Em want-percentage 216object is defined as 217.Em true 218on its dictionary. 219For example: 220.Bd -literal -offset indent 221 \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] 222 \*[Lt]true/\*[Gt] 223.Ed 224.Pp 225Only a value between 0 and 100 is allowed. 226When the limit is reached in the sensor, a 227.Em high-capacity 228event will be sent to the 229.Xr powerd 8 230daemon (if running) and will execute the block for this event in 231.Pa /etc/powerd/scripts/sensor_battery . 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 WarnMax . 237.It maximum-capacity = 99; 238.Pp 239Sets a warning capacity limit property of 99 240percent in a battery sensor. 241Battery sensors are those that report a percentage from the 242.Xr envstat 8 243output. 244.Pp 245It is possible to find out if the sensor accepts this property 246by running 247.Ql envstat -x 248and looking if the 249.Em want-percentage 250object is defined as 251.Em true 252on its dictionary. 253For example: 254.Bd -literal -offset indent 255 \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] 256 \*[Lt]true/\*[Gt] 257.Ed 258.Pp 259Only a value between 0 and 100 is allowed. 260When the limit is reached in the sensor, a 261.Em warning-capacity 262event will be sent to the 263.Xr powerd 8 264daemon (if running) and will execute the block for this event in 265.Pa /etc/powerd/scripts/sensor_battery . 266.Pp 267If this property is set, its value will be shown in the 268.Xr envstat 8 269display output with a column named 270.Ar WarnMin . 271.It critical-max = 70C; 272.Pp 273Sets a critical maximum limit property in a sensor. 274Note that in this example, we are specifying the 275.Ql C 276keyword at the end; that means that this will only be valid for 277.Em temperature 278sensors and that the value is specified as degrees 279.Em Celsius . 280If degrees Fahrenheit are wanted, just use the letter 281.Em F , 282as in: 283.Bd -literal -offset indent 284critical-max = 140F; 285.Ed 286.Pp 287To know sensor type, you have to look at the 288.Em type 289object in the XML property list. 290Remember: the XML property list has 291all the information that the application uses to print the values! 292.Pp 293Other sensors that are not of 294.Em temperature 295type must not include the final character for the unit. 296A dot is allowed in the value, if it corresponds to the 297range that the sensor is reporting. 298When the limit has been reached in the sensor, a 299.Em critical-over 300event will be sent to the 301.Xr powerd 8 302daemon (if running) and will execute the block for this event in 303the appropriate 304.Pa /etc/powerd/scripts/sensor_foo 305script (depending on the sensor's type). 306.Pp 307Please note that this property cannot be set in battery capacity sensors 308(those that have the 309.Em want-percentage 310object in their dictionary). 311This rule applies for the 312.Ql critical-min , 313.Ql warning-max , 314and 315.Ql warning-min 316properties too. 317.Pp 318If this property is set, its value will be shown in the 319.Xr envstat 8 320display output with a column named 321.Ar CritMax . 322.It critical-min = 1.230; 323.Pp 324Sets a critical minimum limit property in a sensor. 325The rules for 326.Em critical-max , 327.Em critical-min , 328.Em warning-max , 329and 330.Em warning-min 331are the same. 332When the limit has been reached in the sensor, a 333.Em critical-under 334event will be sent to the 335.Xr powerd 8 336daemon (if running) and will execute the block for this event in 337the appropriate 338.Pa /etc/powerd/scripts/sensor_foo 339script (depending on the sensor's type). 340.Pp 341If this property is set, its value will be shown in the 342.Xr envstat 8 343display output with a column named 344.Ar CritMin . 345.It warning-max = 70C; 346.Pp 347Sets a warning maximum limit property in a sensor. 348The rules for 349.Em critical-max , 350.Em critical-min , 351.Em warning-max , 352and 353.Em warning-min 354are the same. 355When the limit has been reached in the sensor, a 356.Em warning-over 357event will be sent to the 358.Xr powerd 8 359daemon (if running) and will execute the block for this event in 360the appropriate 361.Pa /etc/powerd/scripts/sensor_foo 362script (depending on the sensor's type). 363.Pp 364Please note that this property cannot be set in battery capacity sensors 365(those that have the 366.Em want-percentage 367object in their dictionary). 368This rule applies for the 369.Ql warning-min 370property too. 371.Pp 372If this property is set, its value will be shown in the 373.Xr envstat 8 374display output with a column named 375.Ar WarnMax . 376.It warning-min = 1.230; 377.Pp 378Sets a critical minimum limit property in a sensor. 379The rules for 380.Em critical-max , 381.Em critical-min , 382.Em warning-max , 383and 384.Em warning-min 385are the same. 386When the limit has been reached in the sensor, a 387.Em warning-under 388event will be sent to the 389.Xr powerd 8 390daemon (if running) and will execute the block for this event in 391the appropriate 392.Pa /etc/powerd/scripts/sensor_foo 393script (depending on the sensor's type). 394.Pp 395If this property is set, its value will be shown in the 396.Xr envstat 8 397display output with a column named 398.Ar WarnMin . 399.It description = string 400.Pp 401Sets a new description in a sensor. 402You can set this property in 403all sensors, except that you won't be able to set a description 404that is currently used for the specified device. 405.It rfact = 56000 406.Pp 407Sets a new resistor factor property in a sensor. 408This property is only allowed in 409.Em Voltage 410sensors and 411.Em only 412if the driver has enabled the appropriate flag for the mentioned 413sensor. 414The resistor factor may be used to change the behavior 415of the value returned by the driver. 416.Pp 417If a sensor supports this, the 418.Em allow-rfact 419object appears enabled (true) in the dictionary. 420.El 421.Pp 422The following properties are available for device blocks: 423.Bl -tag -width ident 424.It refresh-timeout = 10s 425.Pp 426This property sets the refresh timeout value in a driver, and will be used 427to refresh data and check for critical conditions any time the timeout 428is met. 429The value may be specified in seconds, minutes or hours. 430To specify the value in seconds, the 431.Em s 432character must be appended last, if minutes is desired, a 433.Em m 434and a 435.Em h 436for hours. 437For example 438.Em 10s 439for 10 seconds or 440.Em 1h 441for one hour. 442.El 443.Sh FILES 444.Bl -tag -width /etc/envsys.conf -compact 445.It Pa /etc/envsys.conf 446Default configuration file. 447.El 448.Sh SEE ALSO 449.Xr proplib 3 , 450.Xr envstat 8 , 451.Xr powerd 8 452.Sh HISTORY 453The 454.Nm 455configuration file first appeared in 456.Nx 5.0 . 457