xref: /netbsd-src/usr.sbin/envstat/envstat.8 (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1.\"	$NetBSD: envstat.8,v 1.62 2014/05/18 11:46:24 kardel Exp $
2.\"
3.\" Copyright (c) 2000, 2007, 2008, 2009, 2014 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Juan Romero Pardines and Bill Squier.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd May 18, 2014
31.Dt ENVSTAT 8
32.Os
33.Sh NAME
34.Nm envstat
35.Nd utility to handle environmental sensors
36.Sh SYNOPSIS
37.Nm
38.Op Fl DfIklSTWx
39.Op Fl c Ar file
40.Op Fl d Ar device
41.Op Fl i Ar interval
42.Op Fl s Ar "device:sensor,..."
43.Op Fl w Ar width
44.Sh DESCRIPTION
45.Nm
46is a utility that handles various aspects of the sensors
47registered with the
48.Xr envsys 4
49framework.
50It is capable of displaying sensor values as well as
51changing parameters and setting critical limits for the sensors.
52.Pp
53In display mode, column widths as well as displayed sensors
54are fully customizable.
55Critical limits or other properties can be set via the configuration file.
56If critical limits were set previously, the display mode will show
57the critical limits in addition to the current values.
58.Pp
59The following options are available:
60.Bl -tag -width flag
61.It Fl c
62Accepts a file as argument to set properties for sensors in
63devices registered with the framework.
64See the
65.Xr envsys.conf 5
66manual page for more information.
67.It Fl D
68Display the names of the devices that are currently registered with
69the
70.Xr envsys 4
71framework, one per line, along with some properties for the device
72(for example, its refresh timeout value).
73.It Fl d Ar device
74Display only the sensors for the given
75.Ar device .
76This is useful when there are multiple devices registered and
77you want to only see results from a specific device.
78.It Fl f
79Display temperature values in degrees Fahrenheit.
80The default is to display temperature values in degrees Celsius.
81.It Fl I
82This flag skips the sensors with invalid state; these are normally
83shown using the
84.Qq N/A
85string by default.
86.It Fl i Ar interval
87Repeat the display every
88.Ar interval
89seconds.
90Note that some devices do not provide fresh values on demand.
91See the individual device's manual page for meaningful values for
92.Ar interval .
93If not specified, or specified as 0,
94.Nm
95produces one round of values and exits.
96.It Fl k
97Display temperature values in Kelvin.
98The default is to display temperature values in degrees Celsius.
99.It Fl l
100List the names of all supported sensors, one per line.
101Use of this flag causes
102.Nm
103to ignore all other option flags.
104.It Fl r
105This flag is provided for compatibility reasons and there's no need
106to use it.
107In the previous implementation, it was used to enable the
108row mode; this mode is now the default.
109.It Fl S
110This flag is used to restore defaults to all devices registered with
111the framework.
112This will remove all properties that were set in
113the configuration file to the setting that the devices use by
114default.
115.It Fl s Ar "device:sensor,..."
116Restrict the display to the named devices and sensors.
117The pair device and sensor description must be supplied as a comma separated list.
118Device as well as sensor descriptions are case sensitive.
119Note that the order of the arguments given does not influence the order of output.
120.It Fl T
121Create and display max, min and average statistics for a sensor.
122Must be used with an
123.Ar interval ,
124otherwise statistics cannot be collected up.
125Please note that to get realistic
126values a lower interval value should be used, but that will also increase
127overhead.
128.It Fl w Ar width
129Use
130.Ar width
131as the column width for the output.
132Each column is additionally separated by a single space.
133The default is the length of the longest sensor name.
134.It Fl W
135This option has no effect.
136It is retained for historical reasons.
137.It Fl x
138Shows the raw XML property list used by the
139.Xr sysmon_envsys 9
140framework that contains details about all registered devices
141and sensors.
142.El
143.Sh UNITS
144The display mode may show some values with abbreviated units;
145for example:
146.Bl -tag -width "12345678" -compact -offset indent
147.It A
148Amperes
149.It Ah
150Ampere-hours
151.It degC
152degrees Celsius
153.It degF
154degrees Fahrenheit
155.It K
156Kelvin
157.It Ohms
158Ohms
159.It RPM
160Revolutions per minute
161.It V
162Volts DC
163.It VAC
164Volts AC
165.It W
166Watts
167.It Wh
168Watt-hours
169.It %rH
170relative Humidity
171.El
172.Sh EXAMPLES
173To display the
174.Dq charge
175sensor of the device
176.Ar acpibat0
177in one line every ten seconds:
178.Pp
179.Dl $ envstat -s \*qacpibat0:charge\*q -i 10
180.Pp
181To list the devices that are currently registered with
182.Xr envsys 4 :
183.Pp
184.Dl $ envstat -D
185.Pp
186To display the sensors of the device
187.Ar aibs0 :
188.Pp
189.Dl $ envstat -d aibs0
190.Pp
191To set all properties specified in the configuration file:
192.Pp
193.Dl $ envstat -c /etc/envsys.conf
194.Pp
195To remove all properties that were set previously in the configuration
196file:
197.Pp
198.Dl $ envstat -S
199.Pp
200To display statistics for all sensors and ignoring sensors with
201invalid states every second:
202.Pp
203.Dl $ envstat -ITi1
204.Sh SEE ALSO
205.Xr units 1 ,
206.Xr proplib 3 ,
207.Xr acpiacad 4 ,
208.Xr acpibat 4 ,
209.Xr acpitz 4 ,
210.Xr admtemp 4 ,
211.Xr aibs 4 ,
212.Xr amdtemp 4 ,
213.Xr aps 4 ,
214.Xr arcmsr 4 ,
215.Xr battery_pmu 4 ,
216.Xr cac 4 ,
217.Xr coretemp 4 ,
218.Xr dbcool 4 ,
219.Xr envctrl 4 ,
220.Xr envsys 4 ,
221.Xr finsio 4 ,
222.Xr hythygtemp 4 ,
223.Xr ipmi 4 ,
224.Xr itesio 4 ,
225.Xr lm 4 ,
226.Xr lmtemp 4 ,
227.Xr mfi 4 ,
228.Xr nsclpcsio 4 ,
229.Xr owtemp 4 ,
230.Xr pic16lc 4 ,
231.Xr smsc 4 ,
232.Xr tctrl 4 ,
233.Xr thinkpad 4 ,
234.Xr tm121temp 4 ,
235.Xr ug 4 ,
236.Xr viaenv 4 ,
237.Xr envsys.conf 5
238.Sh HISTORY
239.Nm
240appeared in
241.Nx 1.5 .
242It was completely rewritten from scratch for
243.Nx 5.0 .
244.Sh AUTHORS
245.An -nosplit
246The
247.Nm
248utility that appeared in
249.Nx 5.0
250was written by
251.An Juan Romero Pardines .
252The previous version was written by
253.An Bill Squier .
254.Sh BUGS
255When displaying statistics using the
256.Fl T
257option, the average value is an average of the minimum, maximum, and
258current sensor values.
259It is not an average of all current values displayed during the session.
260