| ENVSTAT(8) | System Manager's Manual | ENVSTAT(8) |
envstat — utility
to handle environmental sensors
envstat |
[-DfIjklnSTtW] [-c
file] [-d
device] [-i
interval] [-s
device:sensor,...]
[-w width] |
envstat |
-x [-d
device] [-s
device:sensor,...]
[property ...] |
envstat is a utility that handles various
aspects of the sensors registered with the
envsys(4) framework. It is
capable of displaying sensor values as well as changing parameters and
setting critical limits for the sensors.
In display mode, column widths as well as displayed sensors are fully customizable. Critical limits or other properties can be set via the configuration file. If critical limits were set previously, the display mode will show the critical limits in addition to the current values.
The following options are available:
-c-D-d
device-f-IN/A’ string by
default.-i
intervalenvstat produces one round of values and exits.
When the -j flag is used to get JSON output the
string ‘#-------’ is placed between
each JSON block.-j-k-lenvstat to ignore all other option
flags.-n-T then also display max, min and
average.-r-S-s
device:sensor,...-T-i, otherwise statistics cannot be
collected up. Please note that to get realistic values a lower
interval value should be used, but that will also
increase overhead.-t-j flag is not specified, the time stamp will be
on the first line and be in human readable format. When the output is
JSON, two objects will be included that contain the Julian Unix time and
another with the time stamp in human readable format.-w
width-W-x-d or -s options. If
-s is used with only a single sensor, only the
properties of this sensor are returned, not a list of sensors.The display mode may show some values with abbreviated units; for example:
A |
Amperes |
Ah |
Ampere-hours |
degC |
degrees Celsius |
degF |
degrees Fahrenheit |
K |
Kelvin |
Ohms |
Ohms |
RPM |
Revolutions per minute |
V |
Volts DC |
VAC |
Volts AC |
W |
Watts |
Wh |
Watt-hours |
%rH |
relative Humidity |
hPa |
Hectopascals |
To list the devices that are currently registered with envsys(4):
envstat -DTo display the sensors of the device
‘aibs0’:
envstat -d aibs0To display the ‘charge’
sensor of the device ‘acpibat0’ in one
line every ten seconds:
envstat -s acpibat0:charge -i
10To set all properties specified in the configuration file:
envstat -c
/etc/envsys.confTo remove all properties that were set previously in the configuration file:
envstat -STo display statistics for all sensors and ignoring sensors with invalid states every second:
envstat -ITi1To return a single temperature value:
envstat -s vcmbox0:temperature -x
/cur-valueTo return values of multiple temperature sensors from a single device
envstat -s 'thinkpad0:temperature 0,thinkpad0:temperature 1' \ -x /thinkpad0/0/cur-value /thinkpad0/1/cur-value
To return values of temperature sensors from multiple devices:
envstat -s 'coretemp0:cpu0 temperature,coretemp1:cpu 2 temperature' \ -x /coretemp0/0/cur-value /coretemp1/0/cur-value
To output the sensor data in JSON with a timestamp:
envstat -d owtemp0 -jtunits(1), proplib(3), acpiacad(4), acpibat(4), acpitz(4), admtemp(4), aibs(4), amdtemp(4), aps(4), arcmsr(4), battery_pmu(4), cac(4), dbcool(4), envsys(4), finsio(4), hythygtemp(4), ipmi(4), itesio(4), lm(4), lmtemp(4), mfi(4), nsclpcsio(4), owtemp(4), smsc(4), sparc/tctrl(4), sparc64/envctrl(4), thinkpad(4), tm121temp(4), ug(4), viaenv(4), x86/coretemp(4), envsys.conf(5)
envstat appeared in
NetBSD 1.5. It was completely rewritten from scratch
for NetBSD 5.0.
The envstat utility that appeared in
NetBSD 5.0 was written by Juan
Romero Pardines. The previous version was written by
Bill Squier.
When displaying statistics using the -T
option, the average value is an average of the minimum, maximum, and current
sensor values. It is not an average of all current values displayed during
the session.
| November 14, 2020 | NetBSD 11.0 |