.\" $NetBSD: envsys.conf.5,v 1.14 2012/02/09 18:10:26 riz Exp $ .\" .\" - .\" Copyright (c) 2007, 2008 Juan Romero Pardines. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" .Dd February 15, 2010 .Dt ENVSYS.CONF 5 .Os .Sh NAME .Nm envsys.conf .Nd configuration file for the .Xr envsys 4 framework .Sh SYNOPSIS .Nm envstat .Op Fl S .Op Fl c Ar /etc/envsys.conf .Sh DESCRIPTION The .Nm file configures all the features provided by the .Xr envsys 4 framework. It consists of a series of device and sensor blocks. Each sensor block defines a group of .Em properties . The file format is free-form: new line markers and indentation are ignored. Comments start with a .Sq # sign and extend until the end of line. .Pp A .Em property is like a variable assignment. It has a name, which goes to the left of the equal sign, and a value, which goes to the right. The assignment ends with a semicolon. It looks like: .Pp .Dl name = value; .Pp There is no difference between string or integer values when defining them. The value must be surrounded by double quotes if it contains whitespace. .Pp There can be multiple groups of devices and multiple groups of sensors in the configuration file. .Pp A device block consists of one or more sensor blocks and one or more global properties. It has the following syntax: .Bd -literal -offset indent device_name { prop = value; ... sensor0 { prop = value; ... } ... sensorN { prop = value; ... } } ... .Ed .Pp Device names are those shown by the .Ql envstat -D command; sensor blocks are named by the index position in which they are shown. .Pp For example, if we have the following output from the .Xr envstat 8 command: .Bd -literal -offset indent CPU Temperature: 32.000 degC MB Temperature: 37.000 degC Vcore Voltage: 1.232 V +3.3 Voltage: 3.248 V +5 Voltage: 4.992 V +12 Voltage: 11.985 V CPU FAN Speed: 1250 RPM .Ed .Pp .Ql sensor0 corresponds to the .Em CPU Temperature sensor and .Ql sensor6 corresponds to the .Em CPU FAN Speed sensor. .Pp There is another way that will give you the correct index sensor; the .Ql envstat -x command will print the raw XML property list. You only have to find the .Em index object in the appropriate dictionary. The object will be shown as: .Bd -literal -offset indent \*[Lt]key\*[Gt]index\*[Lt]/key\*[Gt] \*[Lt]string\*[Gt]sensor2\*[Lt]/string\*[Gt] .Ed .Pp Invalid sensors and devices will be detected by the .Xr envstat 8 parser and will be reported as errors. .Pp The following properties are provided for sensor blocks (please note that not all properties apply to all type of sensors): .Bl -tag -width ident .It critical-capacity = 10; .Pp Sets a critical capacity limit property of 10 percent in a battery sensor. Battery sensors are those that report a percentage from the .Xr envstat 8 output. .Pp It is possible to find out if the sensor accepts this property by running .Ql envstat -x and looking if the .Em want-percentage object is defined as .Em true on its dictionary. For example: .Bd -literal -offset indent \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] \*[Lt]true/\*[Gt] .Ed .Pp Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a .Em critical-capacity event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in .Pa /etc/powerd/scripts/sensor_battery . .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar CritMin . .It warning-capacity = 20; .Pp Sets a warning capacity limit property of 20 percent in a battery sensor. Battery sensors are those that report a percentage from the .Xr envstat 8 output. .Pp It is possible to find out if the sensor accepts this property by running .Ql envstat -x and looking if the .Em want-percentage object is defined as .Em true on its dictionary. For example: .Bd -literal -offset indent \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] \*[Lt]true/\*[Gt] .Ed .Pp Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a .Em warning-capacity event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in .Pa /etc/powerd/scripts/sensor_battery . .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar WarnMin . .It high-capacity = 90; .Pp Sets a high capacity limit property of 90 percent in a battery sensor. Battery sensors are those that report a percentage from the .Xr envstat 8 output. .Pp It is possible to find out if the sensor accepts this property by running .Ql envstat -x and looking if the .Em want-percentage object is defined as .Em true on its dictionary. For example: .Bd -literal -offset indent \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] \*[Lt]true/\*[Gt] .Ed .Pp Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a .Em high-capacity event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in .Pa /etc/powerd/scripts/sensor_battery . .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar WarnMax . .It maximum-capacity = 99; .Pp Sets a warning capacity limit property of 99 percent in a battery sensor. Battery sensors are those that report a percentage from the .Xr envstat 8 output. .Pp It is possible to find out if the sensor accepts this property by running .Ql envstat -x and looking if the .Em want-percentage object is defined as .Em true on its dictionary. For example: .Bd -literal -offset indent \*[Lt]key\*[Gt]want-percentage\*[Lt]/key\*[Gt] \*[Lt]true/\*[Gt] .Ed .Pp Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a .Em warning-capacity event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in .Pa /etc/powerd/scripts/sensor_battery . .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar WarnMin . .It critical-max = 70C; .Pp Sets a critical maximum limit property in a sensor. Note that in this example, we are specifying the .Ql C keyword at the end; that means that this will only be valid for .Em temperature sensors and that the value is specified as degrees .Em Celsius . If degrees Fahrenheit are wanted, just use the letter .Em F , as in: .Bd -literal -offset indent critical-max = 140F; .Ed .Pp To know sensor type, you have to look at the .Em type object in the XML property list. Remember: the XML property list has all the information that the application uses to print the values! .Pp Other sensors that are not of .Em temperature type must not include the final character for the unit. A dot is allowed in the value, if it corresponds to the range that the sensor is reporting. When the limit has been reached in the sensor, a .Em critical-over event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in the appropriate .Pa /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). .Pp Please note that this property cannot be set in battery capacity sensors (those that have the .Em want-percentage object in their dictionary). This rule applies for the .Ql critical-min , .Ql warning-max , and .Ql warning-min properties too. .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar CritMax . .It critical-min = 1.230; .Pp Sets a critical minimum limit property in a sensor. The rules for .Em critical-max , .Em critical-min , .Em warning-max , and .Em warning-min are the same. When the limit has been reached in the sensor, a .Em critical-under event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in the appropriate .Pa /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar CritMin . .It warning-max = 70C; .Pp Sets a warning maximum limit property in a sensor. The rules for .Em critical-max , .Em critical-min , .Em warning-max , and .Em warning-min are the same. When the limit has been reached in the sensor, a .Em warning-over event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in the appropriate .Pa /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). .Pp Please note that this property cannot be set in battery capacity sensors (those that have the .Em want-percentage object in their dictionary). This rule applies for the .Ql warning-min property too. .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar WarnMax . .It warning-min = 1.230; .Pp Sets a critical minimum limit property in a sensor. The rules for .Em critical-max , .Em critical-min , .Em warning-max , and .Em warning-min are the same. When the limit has been reached in the sensor, a .Em warning-under event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in the appropriate .Pa /etc/powerd/scripts/sensor_foo script (depending on the sensor's type). .Pp If this property is set, its value will be shown in the .Xr envstat 8 display output with a column named .Ar WarnMin . .It description = string .Pp Sets a new description in a sensor. You can set this property in all sensors, except that you won't be able to set a description that is currently used for the specified device. .It rfact = 56000 .Pp Sets a new resistor factor property in a sensor. This property is only allowed in .Em Voltage sensors and .Em only if the device has enabled the appropriate flag for the mentioned sensor. The resistor factor may be used to change the behavior of the value returned by the device. .Pp If a sensor supports this, the .Em allow-rfact object appears enabled (true) in the dictionary. .El .Pp The following properties are available for device blocks: .Bl -tag -width ident .It refresh-timeout = 10s .Pp This property sets the refresh timeout value in a device, and will be used to refresh data and check for critical conditions any time the timeout is met. The value may be specified in seconds, minutes or hours. To specify the value in seconds, the .Em s character must be appended last, if minutes is desired, a .Em m and a .Em h for hours. For example .Em 10s for 10 seconds or .Em 1h for one hour. .El .Sh FILES .Bl -tag -width /etc/envsys.conf -compact .It Pa /etc/envsys.conf Default configuration file. .El .Sh SEE ALSO .Xr proplib 3 , .Xr envsys 4 , .Xr envstat 8 , .Xr powerd 8 .Sh HISTORY The .Nm configuration file first appeared in .Nx 5.0 .