summaryrefslogtreecommitdiff
path: root/static/netbsd/man8/envstat.8
blob: 856fdcbf4459d3e0c347cc4f994762d60ae96d33 (plain)
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
.\"	$NetBSD: envstat.8,v 1.72 2025/04/01 17:07:58 uwe 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 November 14, 2020
.Dt ENVSTAT 8
.Os
.Sh NAME
.Nm envstat
.Nd utility to handle environmental sensors
.Sh SYNOPSIS
.Nm
.Op Fl DfIjklnSTtW
.Op Fl c Ar file
.Op Fl d Ar device
.Op Fl i Ar interval
.Op Fl s Ar device Ns Cm \&: Ns Ar sensor Ns Cm \&, Ns Ar ...
.Op Fl w Ar width
.Nm
.Fl x
.Op Fl d Ar device
.Op Fl s Ar device Ns Cm \&: Ns Ar sensor Ns Cm \&, Ns Ar ...
.Op Ar property ...
.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 Fl
.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
.Pq 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
.Ql 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.
When the
.Fl j
flag is used to get JSON output the string
.Ql #-------
is placed between each JSON block.
.It Fl j
Output the results in JSON format.
Each output will be a correct JSON object that consists of objects,
arrays, integers, floats and strings included, as needed, for any particular
sensor.
.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 n
Print only the current value of a sensor and no headers.
If statistics are selected with
.Fl T
then also display max, min and average.
.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 Ns Cm \&: Ns Ar sensor Ns Cm \&, Ns Ar ...
Restrict the display to the named devices and sensors.
The pair
.Ar device
and
.Ar 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
.Fl i ,
otherwise statistics cannot be collected up.
Please note that to get realistic
values a lower
.Ar interval
value should be used, but that will also increase overhead.
.It Fl t
Output a time stamp along with the rest of the sensor data.
When the
.Fl 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.
.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.
If
.Ar property
is specified, the value of that property is printed.
The property list can be filtered with the
.Fl d
or
.Fl s
options.
If
.Fl s
is used with only a single sensor, only the properties
of this sensor are returned, not a list of sensors.
.El
.Sh UNITS
The display mode may show some values with abbreviated units;
for example:

.Bl -column -offset indent "degC" "..."
.It Li A    Ta Amperes
.It Li Ah   Ta Ampere-hours
.It Li degC Ta degrees Celsius
.It Li degF Ta degrees Fahrenheit
.It Li K    Ta Kelvin
.It Li Ohms Ta Ohms
.It Li RPM  Ta Revolutions per minute
.It Li V    Ta Volts DC
.It Li VAC  Ta Volts AC
.It Li W    Ta Watts
.It Li Wh   Ta Watt-hours
.It Li %rH  Ta relative Humidity
.It Li hPa  Ta Hectopascals
.El
.Sh EXAMPLES
To list the devices that are currently registered with
.Xr envsys 4 :
.Pp
.Dl envstat -D
.Pp
To display the sensors of the device
.Ql aibs0 :
.Pp
.Dl envstat -d aibs0
.Pp
To display the
.Ql charge
sensor of the device
.Ql acpibat0
in one line every ten seconds:
.Pp
.Dl envstat -s acpibat0:charge -i 10
.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
.Pp
To return a single temperature value:
.Pp
.Dl envstat -s vcmbox0:temperature -x /cur-value
.Pp
To return values of multiple temperature sensors from a single device
.Pp
.Bd -literal -offset indent
envstat -s \(aqthinkpad0:temperature 0,thinkpad0:temperature 1\(aq \e
  -x /thinkpad0/0/cur-value /thinkpad0/1/cur-value
.Ed
.Pp
To return values of temperature sensors from multiple devices:
.Pp
.Bd -literal -offset indent
envstat -s \(aqcoretemp0:cpu0 temperature,coretemp1:cpu 2 temperature\(aq \e
  -x /coretemp0/0/cur-value /coretemp1/0/cur-value
.Ed
.Pp
To output the sensor data in JSON with a timestamp:
.Pp
.Dl envstat -d owtemp0 -jt
.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 dbcool 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 sparc/tctrl 4 ,
.Xr sparc64/envctrl 4 ,
.Xr thinkpad 4 ,
.Xr tm121temp 4 ,
.Xr ug 4 ,
.Xr viaenv 4 ,
.Xr x86/coretemp 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.