1.\" $OpenBSD: sensorsd.conf.5,v 1.24 2011/12/03 23:01:21 schwarze Exp $ 2.\" 3.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org> 4.\" Copyright (c) 2005 Matthew Gream <matthew.gream@pobox.com> 5.\" Copyright (c) 2007 Constantine A. Murenin <cnst@openbsd.org> 6.\" 7.\" Permission to use, copy, modify, and distribute this software for any 8.\" purpose with or without fee is hereby granted, provided that the above 9.\" copyright notice and this permission notice appear in all copies. 10.\" 11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18.\" 19.Dd $Mdocdate: December 3 2011 $ 20.Dt SENSORSD.CONF 5 21.Os 22.Sh NAME 23.Nm sensorsd.conf 24.Nd configuration file for sensorsd 25.Sh DESCRIPTION 26The 27.Nm 28file is read by 29.Xr sensorsd 8 30to configure hardware sensor monitoring. 31Each sensor registered in the system 32is matched by at most one entry in 33.Nm , 34which may specify high and low limits, 35and whether sensor status changes provided by the driver should be ignored. 36If the limits are crossed or if the status provided by the driver changes, 37.Xr sensorsd 8 Ns 's 38alert functionality is triggered and a command, if specified, is 39executed. 40.Pp 41.Nm 42follows the syntax of configuration databases as documented in 43.Xr getcap 3 . 44Sensors may be specified by their full 45.Va hw.sensors 46.Xr sysctl 8 47variable name or by type, 48with the full name taking precedence. 49For example, if an entry 50.Dq hw.sensors.lm0.temp1 51is not found, then an entry for 52.Dq temp 53will instead be looked for. 54.Pp 55The following attributes may be used: 56.Pp 57.Bl -tag -width "commandXX" -offset indent -compact 58.It Li command 59Specify a command to be executed on state change. 60.It Li high 61Specify an upper limit. 62.It Li low 63Specify a lower limit. 64.It Li istatus 65Ignore status provided by the driver. 66.El 67.Pp 68The values for temperature sensors can be given in degrees Celsius or 69Fahrenheit, for voltage sensors in volts, and fan speed sensors take a 70unit-less number representing RPM. 71Values for all other types of sensors can be specified 72in the same units as they appear under the 73.Xr sysctl 8 74.Va hw.sensors 75tree. 76.Pp 77Sensors that provide status (such as those from 78.Xr bio 4 , 79.Xr esm 4 , 80or 81.Xr ipmi 4 ) 82do not require boundary values specified 83and simply trigger on status transitions. 84If boundaries are specified nonetheless, 85then they are used in addition to automatic status monitoring, 86unless the 87.Dq istatus 88attribute is specified to ignore status values that are provided by the drivers. 89.Pp 90The command is executed when there is any change in sensor state. 91Tokens in the command are substituted as follows: 92.Pp 93.Bl -tag -width Ds -offset indent -compact 94.It %l 95Whether the value exceeds or is within the user specified limits. 96Can be one of: "below", "above", "within", "invalid", or "uninitialised". 97.It %n 98The sensor number. 99.It %s 100The sensor status. 101.It %x 102The xname of the device the sensor sits on. 103.It %t 104The type of sensor. 105.It %2 106The sensor's current value. 107.It %3 108The sensor's low limit. 109.It %4 110The sensor's high limit. 111.El 112.Pp 113By default, 114.Xr sensorsd 8 115monitors status changes on all sensors that keep their state. 116This behaviour may be altered by using the 117.Dq istatus 118attribute to ignore 119status changes of sensors of a certain type 120or individual sensors. 121.Sh FILES 122.Bl -tag -width "/etc/sensorsd.conf" 123.It /etc/sensorsd.conf 124Configuration file for 125.Xr sensorsd 8 . 126.El 127.Sh EXAMPLES 128In the following configuration file, 129if hw.sensors.ipmi0.temp0 transitions 80C or 130if its status as provided by 131.Xr ipmi 4 132changes, the command 133.Pa /etc/sensorsd/log_warning 134will be executed, 135with the sensor type, number and current value passed to it. 136Alerts will be sent 137if hw.sensors.lm0.volt3 transitions to being within or outside 138a range of 4.8V and 5.2V; 139if the speed of the fan attached to hw.sensors.lm0.fan1 140transitions to being below or above 1000RPM; 141if any RAID volume drive 142changes its status from, for example, 143.Dq OK , 144such as in the case of drive failure, rebuild, or a complete failure, 145the command 146.Pa /etc/sensorsd/drive 147will be executed, with the sensor number passed to it; however, 148no alerts will be generated for status changes on timedelta sensors. 149For all other sensors whose drivers automatically provide 150sensor status updates, alerts will be generated 151each time those sensors undergo status transitions. 152.Bd -literal -offset indent 153# Comments are allowed 154hw.sensors.ipmi0.temp0:high=80C:command=/etc/sensorsd/log_warning %t %n %2 155hw.sensors.lm0.volt3:low=4.8V:high=5.2V 156hw.sensors.lm0.fan1:low=1000 157drive:command=/etc/sensorsd/drive %n 158timedelta:istatus #ignore status changes for timedelta 159.Ed 160.Sh SEE ALSO 161.Xr getcap 3 , 162.Xr bio 4 , 163.Xr ipmi 4 , 164.Xr sensorsd 8 , 165.Xr sysctl 8 166.Sh HISTORY 167The 168.Nm 169file format first appeared in 170.Ox 3.5 . 171The format was altered in 172.Ox 4.1 173to accommodate hierarchical device-based sensor addressing. 174The 175.Dq istatus 176attribute was introduced in 177.Ox 4.2 . 178.Sh CAVEATS 179Alert functionality is triggered every time there is a change in sensor state; 180for example, when 181.Xr sensorsd 8 182is started, 183the status of each monitored sensor changes 184from undefined to whatever it is. 185One must keep this in mind when using commands 186that may unconditionally perform adverse actions (e.g.\& 187.Xr shutdown 8 ) , 188as they will be executed even when all sensors perform to specification. 189If this is undesirable, then a wrapper shell script should be used instead. 190