Home | History | Annotate | Line # | Download | only in envstat
envsys.conf.5 revision 1.4
 $NetBSD: envsys.conf.5,v 1.4 2007/10/09 08:00:46 xtraeme Exp $

-
Copyright (c) 2007 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 October 7, 2007 .Dt ENVSYS.CONF 5 .Os .Sh NAME .Nm envsys.conf .Nd Configuration file for the envsys framework .Sh SYNOPSIS envstat .Op Fl c Ar /etc/envsys.conf .Op Fl S .Sh DESCRIPTION The .Nm file configures all the features provided by the .Xr envsys framework. It is composed by series of .Em device and .Em sensor blocks . Each .Em sensor block defines a group of .Em properties . The file format is free-form: new line markers are ignored as well as indentation. Comments start with the .Sq # sign and extend until the end of line.

p 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:

p .Dl name = value;

p There is no difference between string or integer values when defining them. The value must be surrounded by double quotes if it contains whitespace.

p There can be multiple groups of devices and multiple groups of sensors in the configuration file.

p A device block consists of one or multiple sensor blocks. It has the following syntax: d -literal -offset indent device_name { sensor0 { prop = value; ... } ... sensorN { prop = value; ... } } ... .Ed

p Device names are those shown by the .Ql envstat -D command; Sensor blocks are named by its index position in which they are shown.

p For example, if we have the following output from the .Xr envstat 8 command: d -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

p .Ql sensor0 corresponds to the .Em CPU Temperature sensor and .Ql sensor6 corresponds to the .Em CPU FAN Speed sensor.

p 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 appropiate dictionary. The object will be shown as: d -literal -offset indent <key>index</key> <string>sensor2</string> .Ed

p Invalid sensors and devices will be detected by the .Xr envstat 8 parser and will be reported as errors.

p The following properties are provided (please note that not all properties apply to all type of sensors): l -tag -width ident t critical-capacity = 10;

p Sets a critical capacity limit property of 10 .Em percent in a .Em battery sensor . Battery sensors are those that report a percentage from the .Xr envstat 8 output.

p It is also possible to know 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: d -literal -offset indent <key>want-percentage</key> <true/> .Ed

p Only a value between 0 and 100 is allowed. When the limit is reached in the sensor, a .Em user-capacity event will be sent to the .Xr powerd 8 daemon (if running) and will execute the block for this event in the

a /etc/powerd/scripts/sensor_battery . t critical-max = 70C;

p Sets a critical max 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 is wanted, just change it to a .Em F , like: d -literal -offset indent critical-max = 140F; .Ed

p To know the type of sensor, 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!.

p Other sensors that are not of .Em temperature type, must not specify the final character for degrees. Also a dot is allowed in the value, if that 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 appropiate

a /etc/powerd/scripts/sensor_foo script (depending of sensor's type).

p Please note that this property cannot be set in battery sensors (those that have the .Em want-percentage object on its dictionary), this same rule must be applied for the .Ql critical-min property. t critical-min = 1.230;

p Sets a critical min limit property in a sensor. The rules for .Em critical-max and .Em critical-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 appropiate

a /etc/powerd/scripts/sensor_foo script (depending of sensor's type). t description = string

p 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. t rfact = 56000;

p Sets a new resistor factor property in a sensor. This property is only allowed in .Em Voltage sensors and .Em only if the driver has enabled the appropiate flag for the mentioned sensor. The resistor factor may be used to change the behavior of the value returned by the driver.

p To know if the sensor supports this, the .Em allow-rfact object must appear enabled (true) in the dictionary. .El .Sh FILES l -tag -width /etc/envsys.conf -compact t Pa /etc/envsys.conf Default configuration file. .El .Sh SEE ALSO .Xr proplib 3 , .Xr envstat 8 , .Xr powerd 8 .Sh HISTORY The .Nm configuration file first appeared in .Nx 5.0 .