configuration file for sensorsd
file is read by
hardware sensor monitoring. Each variable in the
subtree represents a sensor. Each
sensor is matched by at most one entry in
, which may specify high and
low limits, and whether sensor status changes provided by the driver should be
ignored. Each time the limits are crossed in either direction or the status
provided by the driver changes,
functionality is triggered and a command, if specified, is executed.
follows the syntax of
configuration databases as documented in
. Sensors may be
specified by their full hw.sensors
variable name or by
type, with the full name taking precedence. For example, if an entry
“hw.sensors.lm0.temp1” is not found, then an entry for
“temp” will instead be looked for.
The following attributes may be used:
- Specify a command to be executed on state change.
- Specify the largest acceptable value.
- Specify the smallest acceptable value.
- Ignore status provided by the driver.
The values for temperature sensors can be given in degrees Celsius or
Fahrenheit, for voltage sensors in volts, and fan speed sensors take a
unit-less number representing RPM. For Boolean sensors, specify 0 for
“Off” or 1 for “On”. Values for all other types of
sensors can be specified in the same units as they appear under the
Sensors that provide status (such as those from
) do not require boundary
values specified and simply trigger on status transitions. If boundaries are
specified nonetheless, then they are used in addition to automatic status
monitoring, unless the “istatus” attribute is specified to
ignore status values that are provided by the drivers.
The command is executed when there is any change in sensor state. Tokens in the
command are substituted as follows:
- Whether the value exceeds or is within the user specified limits. Can be
one of: "below", "above", "within",
"invalid", or "uninitialised".
- The sensor number.
- The sensor status.
- The xname of the device the sensor sits on.
- The type of sensor.
- The sensor's current value.
- The sensor's low limit.
- The sensor's high limit.
For Boolean sensors, %2, %3, and %4 are substituted with “On” or
By default, sensorsd(8)
status changes on all sensors that keep their state. This behaviour may be
altered by using the “istatus” attribute to ignore status
changes of sensors of a certain type or individual sensors.
- Configuration file for
In the following configuration file, if hw.sensors.ipmi0.temp0 moves upwards
beyond 80C or downwards to 80C or less or if its status as provided by
changes, the command
will be executed,
with the sensor type, number and current value passed to it. Alerts will be
sent if hw.sensors.lm0.volt3 moves into or out of the range from 4.8V to 5.2V,
inclusive; if the speed of the fan attached to hw.sensors.lm0.fan1 transitions
to being below or above 1000RPM; if any RAID volume drive changes its status
from, for example, “OK”, such as in the case of drive failure,
rebuild, or a complete failure, the command
will be executed, with
the sensor number passed to it; however, no alerts will be generated for
status changes on timedelta sensors. For all other sensors whose drivers
automatically provide sensor status updates, alerts will be generated each
time those sensors undergo status transitions.
# Comments are allowed
hw.sensors.ipmi0.temp0:high=80C:command=/etc/sensorsd/log_warning %t %n %2
timedelta:istatus #ignore status changes for timedelta
file format first appeared
in OpenBSD 3.5
. The format was altered in
to accommodate hierarchical device-based
sensor addressing. The “istatus” attribute was introduced in
Alert functionality is triggered every time there is a change in sensor state;
for example, when sensorsd(8)
is started, the status of each monitored sensor changes from undefined to
whatever it is. One must keep this in mind when using commands that may
unconditionally perform adverse actions (e.g.
), as they will be
executed even when all sensors perform to specification. If this is
undesirable, then a wrapper shell script should be used instead.