envsys(4) scripts are called when a condition was triggered in a sensor. These scripts are called with three arguments: the device associated, the event type, and the sensor's name. The
sensor_drive and the
sensor_battery scripts uses a fourth argument: state description.
The following envsys script names are defined:
sensor_battery
This script is called when an event occurs on a battery sensor (Wh/Ah/Battery state).
sensor_drive
This script is called when an event occurs on a drive sensor.
sensor_fan
This script is called when an event occurs on a fan sensor.
sensor_indicator
This script is called when an event ocurrs on a indicator/integer sensor.
sensor_power
This script is called when an event occurs on a power sensor (W/Ampere).
sensor_resistance
This script is called when an event occurs on a resistance sensor (Ohm).
sensor_temperature
This script is called when an event occurs on a temperature sensor.
sensor_voltage
This script is called when an event occurs on a voltage sensor.
The following events are defined for fan, indicator, power, resistance, temperature, and voltage sensors:
critical
A critical condition was triggered.
critical-under
A critical under condition was triggered.
critical-over
A critical over condition was triggered.
warning-under
A warning under condition was triggered.
warning-over
A warning over condition was triggered.
The following event is defined for all scripts, but it is only sent if any of the previous events has been previously sent:
normal
A normal state/capacity/condition was triggered.
The following events are defined only for battery sensors:
user-capacity
Capacity dropped below the limit set by the user.
low-power
System is running in low power. This implies that the AC adapter is disconnected and all batteries are in critical or low capacity. The script shutdowns the system gracefully by default.
The following events are defined for drive and battery sensors:
state-changed
The state of the sensor has been changed and it is not in the normal state.
The following is an example of how a temperature sensor script might be invoked when a critical over condition is triggered:
/etc/powerd/scripts/sensor_temperature lm0 critical-over "CPU Temp"