Commit Graph

35 Commits

Author SHA1 Message Date
xtraeme 2577f77bbc Add the -r flag, which is a dummy flag... only added for compatibility
reasons.
2007-07-17 13:12:46 +00:00
xtraeme 45e944a6cf Define a set of macros to avoid writting same code many times. 2007-07-13 00:42:57 +00:00
xtraeme 425df11cce Add a missing printf in parse_dictionary() and simplify this part to
avoid code duplication in two places.
2007-07-12 22:52:54 +00:00
xtraeme 0938d9b438 Remove a comment that is not valid anymore. 2007-07-12 18:34:07 +00:00
xtraeme ff9bb2708d - Do not refrence memory already freed, thanks to Geoff C. Wing for
the analysis. Closes PR bin/36636.
- Also use the longest string for the column alignment counting all
  sensors available from all devices, not per-device.

Thanks to rmind@ for help.
2007-07-12 18:24:35 +00:00
xtraeme 2ce86bd863 Align drive state string like other sensor types. 2007-07-05 14:11:08 +00:00
xtraeme 84b0b63b4c Before checking sensor type:
- check if if its state is invalid
- print the 'N/A' string and continue

This avoids code duplication.
2007-07-05 14:08:37 +00:00
xtraeme 7233bc845c Print invalid state with 'N/A' for Indicators, like any other sensors.
We follow the following scheme now:

value_cur set => ON
value_cur not set => OFF
invalid state => N/A
2007-07-05 13:51:28 +00:00
xtraeme ada961ab89 Print 'N/A' for invalid sensors rather than an asterisk, with the
exception of Indicator sensors.

Indicator sensors now will print "ON" if they are in valid state, or
"OFF" if they are in invalid state.
2007-07-05 12:11:05 +00:00
xtraeme 96deb6cebd By popular demand, do not skip sensors with invalid state. Print them
with an asterisk, as was suggested by Greg. A. Woods.

Example:

$ ./envstat -dlm0 -s "CPU Fan,System Fan,Aux Fan"
     System Fan:       *
     CPU Fan:       1308 RPM
     Aux Fan:          *
$

Except Integer and Driver sensors, which shouldn't need that.
2007-07-04 19:56:02 +00:00
xtraeme af211bb4e3 Imported envsys 2, a brief description of the new features:
(Part 3: userland)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 07:39:45 +00:00
bouyer 982bad256f Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
2007-05-01 17:18:52 +00:00
gson d9fde78727 In -i mode, flush standard output after each line. This is needed to
make the output appear in a timely fashion when redirected to a file
or pipe.
2006-08-31 10:25:04 +00:00
wiz 996e601d13 One r in the option string is enough; from Jeff Ito. 2004-06-03 16:48:53 +00:00
wiz 50c34bcf41 Remove unhandled option letter c from option string, noted by Jeff Ito. 2004-06-03 15:47:04 +00:00
wiz 856533536c Sync usage with man page.
From Kouichirou Hiratsuka in PR 25798.
2004-06-03 14:51:32 +00:00
mrg 1505f78b5b - move the row printing code into it's own function.
- pay attention to interval processing with row printing (-r -iN).

the latter fixes PR#24522.
2004-03-25 01:26:57 +00:00
mrg 057c3b737e in -r mode, if given "-s sensor_list", only list the given sensors instead
of always listing them all
2004-03-21 10:52:26 +00:00
soren 12e7c81811 As pointed out by Dave Huang, revert back to using 273.15 rather than 273.16
when converting between kelvin and celsius.
2004-02-02 10:36:19 +00:00
soren cf458c9f73 C = K + 273.16. 2004-02-02 07:55:14 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
mycroft e7e5d0f4f6 Don't display data for sensors with ENVSYS_FCURVALID not set.
Clean up a little.
2003-10-31 20:37:53 +00:00
martin 89fe22c05c Not all size_t's are equal to int... 2003-02-21 07:23:43 +00:00
christos c837eea5e5 - pass lint
- use size_t where appropriate
- use err/warn instead of printf, and don't hide the error messages from ioctl.
- keep units in sync (someone added integer in the header file and forgot
  to update envsys.c)
2003-02-20 20:57:08 +00:00
christos 1748ad5426 fix usage [add -r] 2003-01-11 23:44:47 +00:00
christos cee2d9b418 exit 0 when -r 2003-01-05 22:16:22 +00:00
chris 8eae0df210 Update -r option to display data in correct units, IE temperature in degC or
degF, fan speed is now correct, and indicators will now show ON/OFF.
2003-01-05 01:56:42 +00:00
augustss 9381d1a428 Include <paths.h> 2003-01-01 12:16:40 +00:00
augustss a57c1af9e5 ANSIfy. 2003-01-01 12:14:21 +00:00
explorer 0c77fcf312 add ENVSYS_INDICATOR and ENVSYS_INTEGER types 2002-12-31 05:27:29 +00:00
cgd 25bdbb661e convert to use getprogname() 2001-02-19 23:22:40 +00:00
augustss 826490bf58 Indicate that the device argument is not mandatory. 2000-07-02 00:55:47 +00:00
thorpej 3cf08199ac If the `device' argument is not specified, attempt to open /dev/sysmon. 2000-06-24 00:41:10 +00:00
simonb fd4ede242b Don't declare 'extern opt*' getopt variables. 2000-04-14 06:26:52 +00:00
groo 38cfdfd8fc Add envstat(8) for displaying sensor readings from any envsys(4)
compatible device.
2000-03-10 05:51:56 +00:00