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