1*c9d6433dSschwarze.\" $OpenBSD: sensorsd.conf.5,v 1.29 2020/02/10 13:18:22 schwarze Exp $ 200a49680Shenning.\" 300a49680Shenning.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org> 4ee263a2cShshoexer.\" Copyright (c) 2005 Matthew Gream <matthew.gream@pobox.com> 54ccc66eeScnst.\" Copyright (c) 2007 Constantine A. Murenin <cnst@openbsd.org> 600a49680Shenning.\" 700a49680Shenning.\" Permission to use, copy, modify, and distribute this software for any 800a49680Shenning.\" purpose with or without fee is hereby granted, provided that the above 900a49680Shenning.\" copyright notice and this permission notice appear in all copies. 1000a49680Shenning.\" 1100a49680Shenning.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1200a49680Shenning.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1300a49680Shenning.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1400a49680Shenning.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1500a49680Shenning.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1600a49680Shenning.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1700a49680Shenning.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1800a49680Shenning.\" 19*c9d6433dSschwarze.Dd $Mdocdate: February 10 2020 $ 2000a49680Shenning.Dt SENSORSD.CONF 5 2100a49680Shenning.Os 2200a49680Shenning.Sh NAME 2300a49680Shenning.Nm sensorsd.conf 2457796b54Sjmc.Nd configuration file for sensorsd 2500a49680Shenning.Sh DESCRIPTION 2600a49680ShenningThe 2700a49680Shenning.Nm 2800a49680Shenningfile is read by 2900a49680Shenning.Xr sensorsd 8 3000a49680Shenningto configure hardware sensor monitoring. 312069f8e0SschwarzeEach variable in the 32aaeccf36Sderaadt.Xr sysctl 2 332069f8e0Sschwarze.Va hw.sensors 342069f8e0Sschwarzesubtree represents a sensor. 352069f8e0SschwarzeEach sensor is matched by at most one entry in 36e2445bfeScnst.Nm , 37d62c2f6dScnstwhich may specify high and low limits, 3834100cd6Sjmcand whether sensor status changes provided by the driver should be ignored. 392069f8e0SschwarzeEach time the limits are crossed in either direction 402069f8e0Sschwarzeor the status provided by the driver changes, 41bf1c21e6Sschwarze.Xr sensorsd 8 Ns 's 42571b9c0cSjmcalert functionality is triggered and a command, if specified, is 43ee263a2cShshoexerexecuted. 4400a49680Shenning.Pp 4500a49680Shenning.Nm 4600a49680Shenningfollows the syntax of configuration databases as documented in 47647427d6Sderaadt.Xr cgetent 3 . 4834100cd6SjmcSensors may be specified by their full 49e2445bfeScnst.Va hw.sensors 50e2445bfeScnst.Xr sysctl 8 5134100cd6Sjmcvariable name or by type, 5234100cd6Sjmcwith the full name taking precedence. 5334100cd6SjmcFor example, if an entry 5434100cd6Sjmc.Dq hw.sensors.lm0.temp1 5534100cd6Sjmcis not found, then an entry for 5634100cd6Sjmc.Dq temp 5734100cd6Sjmcwill instead be looked for. 5834100cd6Sjmc.Pp 5957796b54SjmcThe following attributes may be used: 6000a49680Shenning.Pp 6157796b54Sjmc.Bl -tag -width "commandXX" -offset indent -compact 6257796b54Sjmc.It Li command 634ccc66eeScnstSpecify a command to be executed on state change. 6457796b54Sjmc.It Li high 652069f8e0SschwarzeSpecify the largest acceptable value. 6657796b54Sjmc.It Li low 672069f8e0SschwarzeSpecify the smallest acceptable value. 68d62c2f6dScnst.It Li istatus 6934100cd6SjmcIgnore status provided by the driver. 7057796b54Sjmc.El 7100a49680Shenning.Pp 7200a49680ShenningThe values for temperature sensors can be given in degrees Celsius or 7300a49680ShenningFahrenheit, for voltage sensors in volts, and fan speed sensors take a 7400a49680Shenningunit-less number representing RPM. 752069f8e0SschwarzeFor Boolean sensors, specify 0 for 762069f8e0Sschwarze.Qq Off 772069f8e0Sschwarzeor 1 for 782069f8e0Sschwarze.Qq On . 793c73614cScnstValues for all other types of sensors can be specified 803c73614cScnstin the same units as they appear under the 813c73614cScnst.Xr sysctl 8 823c73614cScnst.Va hw.sensors 833c73614cScnsttree. 84ee263a2cShshoexer.Pp 854ccc66eeScnstSensors that provide status (such as those from 8695e9805cSmickey.Xr bio 4 , 87b378b61dSjmc.Xr esm 4 , 88db03aeabSmickeyor 8995e9805cSmickey.Xr ipmi 4 ) 904ccc66eeScnstdo not require boundary values specified 914ccc66eeScnstand simply trigger on status transitions. 924ccc66eeScnstIf boundaries are specified nonetheless, 934ccc66eeScnstthen they are used in addition to automatic status monitoring, 944ccc66eeScnstunless the 954ccc66eeScnst.Dq istatus 964ccc66eeScnstattribute is specified to ignore status values that are provided by the drivers. 97db03aeabSmickey.Pp 984ccc66eeScnstThe command is executed when there is any change in sensor state. 9957796b54SjmcTokens in the command are substituted as follows: 10057796b54Sjmc.Pp 10157796b54Sjmc.Bl -tag -width Ds -offset indent -compact 1023e90544bSckuethe.It %l 103db7d6ff8SjmcWhether the value exceeds or is within the user specified limits. 1042115560dScnstCan be one of: "below", "above", "within", "invalid", or "uninitialised". 105db7d6ff8Sjmc.It %n 106db7d6ff8SjmcThe sensor number. 107db7d6ff8Sjmc.It %s 108db7d6ff8SjmcThe sensor status. 109db7d6ff8Sjmc.It %x 110db7d6ff8SjmcThe xname of the device the sensor sits on. 111db7d6ff8Sjmc.It %t 112db7d6ff8SjmcThe type of sensor. 11357796b54Sjmc.It %2 114db7d6ff8SjmcThe sensor's current value. 11557796b54Sjmc.It %3 116db7d6ff8SjmcThe sensor's low limit. 11757796b54Sjmc.It %4 118db7d6ff8SjmcThe sensor's high limit. 11957796b54Sjmc.El 120d62c2f6dScnst.Pp 1212069f8e0SschwarzeFor Boolean sensors, %2, %3, and %4 are substituted with 1222069f8e0Sschwarze.Qq On 1232069f8e0Sschwarzeor 1242069f8e0Sschwarze.Qq Off . 1252069f8e0Sschwarze.Pp 126d62c2f6dScnstBy default, 127d62c2f6dScnst.Xr sensorsd 8 128d62c2f6dScnstmonitors status changes on all sensors that keep their state. 129d62c2f6dScnstThis behaviour may be altered by using the 130d62c2f6dScnst.Dq istatus 13134100cd6Sjmcattribute to ignore 13234100cd6Sjmcstatus changes of sensors of a certain type 13334100cd6Sjmcor individual sensors. 13400a49680Shenning.Sh FILES 135*c9d6433dSschwarze.Bl -tag -width /etc/examples/sensorsd.conf -compact 136b9170857Ssobrado.It Pa /etc/sensorsd.conf 13700a49680ShenningConfiguration file for 13800a49680Shenning.Xr sensorsd 8 . 139*c9d6433dSschwarze.It Pa /etc/examples/sensorsd.conf 140*c9d6433dSschwarzeExample configuration file. 14100a49680Shenning.El 14257796b54Sjmc.Sh EXAMPLES 14357796b54SjmcIn the following configuration file, 1442069f8e0Sschwarzeif hw.sensors.ipmi0.temp0 moves upwards beyond 80C 1452069f8e0Sschwarzeor downwards to 80C or less or if its status as provided by 146f926b4c2Scnst.Xr ipmi 4 147f926b4c2Scnstchanges, the command 14857796b54Sjmc.Pa /etc/sensorsd/log_warning 14957796b54Sjmcwill be executed, 15096fb8c11Sderaadtwith the sensor type, number and current value passed to it. 151f926b4c2ScnstAlerts will be sent 1522069f8e0Sschwarzeif hw.sensors.lm0.volt3 moves into or out of 1532069f8e0Sschwarzethe range from 4.8V to 5.2V, inclusive; 15496fb8c11Sderaadtif the speed of the fan attached to hw.sensors.lm0.fan1 155f926b4c2Scnsttransitions to being below or above 1000RPM; 156d62c2f6dScnstif any RAID volume drive 157f926b4c2Scnstchanges its status from, for example, 158b378b61dSjmc.Dq OK , 159f926b4c2Scnstsuch as in the case of drive failure, rebuild, or a complete failure, 160f926b4c2Scnstthe command 161d62c2f6dScnst.Pa /etc/sensorsd/drive 162d62c2f6dScnstwill be executed, with the sensor number passed to it; however, 163d62c2f6dScnstno alerts will be generated for status changes on timedelta sensors. 164d62c2f6dScnstFor all other sensors whose drivers automatically provide 165d62c2f6dScnstsensor status updates, alerts will be generated 166d62c2f6dScnsteach time those sensors undergo status transitions. 16757796b54Sjmc.Bd -literal -offset indent 16857796b54Sjmc# Comments are allowed 16996fb8c11Sderaadthw.sensors.ipmi0.temp0:high=80C:command=/etc/sensorsd/log_warning %t %n %2 17096fb8c11Sderaadthw.sensors.lm0.volt3:low=4.8V:high=5.2V 171f926b4c2Scnsthw.sensors.lm0.fan1:low=1000 172d62c2f6dScnstdrive:command=/etc/sensorsd/drive %n 173d62c2f6dScnsttimedelta:istatus #ignore status changes for timedelta 17457796b54Sjmc.Ed 17500a49680Shenning.Sh SEE ALSO 176647427d6Sderaadt.Xr cgetent 3 , 177db03aeabSmickey.Xr bio 4 , 178db03aeabSmickey.Xr ipmi 4 , 17957796b54Sjmc.Xr sensorsd 8 , 18057796b54Sjmc.Xr sysctl 8 18100a49680Shenning.Sh HISTORY 18200a49680ShenningThe 18300a49680Shenning.Nm 18400a49680Shenningfile format first appeared in 18500a49680Shenning.Ox 3.5 . 1864ccc66eeScnstThe format was altered in 1874ccc66eeScnst.Ox 4.1 1884ccc66eeScnstto accommodate hierarchical device-based sensor addressing. 1894ccc66eeScnstThe 1904ccc66eeScnst.Dq istatus 1914ccc66eeScnstattribute was introduced in 1924ccc66eeScnst.Ox 4.2 . 1934ccc66eeScnst.Sh CAVEATS 1944ccc66eeScnstAlert functionality is triggered every time there is a change in sensor state; 1954ccc66eeScnstfor example, when 1964ccc66eeScnst.Xr sensorsd 8 1974ccc66eeScnstis started, 1984ccc66eeScnstthe status of each monitored sensor changes 1994ccc66eeScnstfrom undefined to whatever it is. 2004ccc66eeScnstOne must keep this in mind when using commands 2014ccc66eeScnstthat may unconditionally perform adverse actions (e.g.\& 2024ccc66eeScnst.Xr shutdown 8 ) , 2034ccc66eeScnstas they will be executed even when all sensors perform to specification. 2044ccc66eeScnstIf this is undesirable, then a wrapper shell script should be used instead. 205