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