Commit Graph

110 Commits

Author SHA1 Message Date
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
xtraeme dbce9233f7 Don't show statistics in sensors that will provide a percentage. 2008-04-29 21:46:17 +00:00
xtraeme b02a77aff5 Add missing cast, noticed by Paul Goyette in current-users@. 2008-04-26 20:58:51 +00:00
xtraeme f4ac0ac2c7 Cur -> Current for the header. 2008-04-26 11:28:26 +00:00
xtraeme 7dbfb3923c In default display mode, fix up the indentation for the critical
limits so that they appear in the correct column.
2008-04-26 11:15:14 +00:00
xtraeme f960b01be8 * Improve default display output by adding a header that will match
current value as well as critical limits set and sensor unit.

* Add a new flag: -T. When it's enabled statistics will be created for
  the sensors. Max, min and average statistics as well as sensor unit
  will be displayed. Must be used with an interval.

You can see the new code in action here:

http://www.netbsd.org/~xtraeme/envstat_stats.txt

Thanks to jmcneill@ for comments and ideas.
2008-04-26 02:56:57 +00:00
cegger 68519ac971 amdtemp(4): Driver for AMD CPU Temperature Sensors. Adopted from OpenBSD's kate(4).
Changes beyond OpenBSD's driver:
- Improved support for AMD K8
- Added support for AMD Barcelona, AMD Phenom and AMD Griffin
Tested on various single and multi-socket machines.
Review and OK xtreame
2008-04-22 22:37:12 +00:00
xtraeme e7638e85c4 Remove the 'dvnprinted' bool member of sensor_t, it's unused. 2008-04-17 21:19:12 +00:00
xtraeme b16a06cd38 * Add support to show output from specified sensors in multiple devices
via the -s flag (the requirement for -d is not there anymore). [1]

You can do something like the following now:

$ envstat -s "acpibat0:charge,acpibat0:charge state,acpitz0:temperature"
[acpibat0]
       charge:      3.015 Ah (79.70%)
 charge state:     NORMAL
[acpitz0]
  temperature:     54.000 degC
$

* As bonus, the code has been modified to use a simple queue for
  the sensors, and this has simplified and improved some parts of the
  code as well.

[1] Item requested by joerg@ yesterday.
2008-04-17 20:51:48 +00:00
xtraeme ba517bc7f5 Mention finsio(4). 2008-04-03 22:51:53 +00:00
xtraeme 979262d0fe Mention pic16lc(4). 2008-04-02 14:29:45 +00:00
xtraeme e984f5b1da Mention cac(4). 2008-04-02 14:17:40 +00:00
xtraeme 42d9037c3c Mention adt7463c(4) and thinkpad(4) even if the manpages don't exist.
This is to have a reference about which drivers are using the envsys
framework.
2008-04-02 14:15:27 +00:00
xtraeme f88582eca6 Xref arcmsr(4). 2008-02-29 20:59:37 +00:00
xtraeme 16f978c748 Fix a bug in the 'refresh-timeout' device property that was giving
the same value to all devices even if the configuration file was
changed.
2008-02-02 01:44:04 +00:00
xtraeme e2749a8b14 Xref battery_pmu(4). 2007-12-12 20:27:30 +00:00
wiz 163e44444f Sort SEE ALSO. 2007-12-01 18:56:42 +00:00
xtraeme 27ddba0559 Implement the 'refresh-timeout' property in device blocks for the
configuration files. This sets the timeout value that will be used
to check for critical limits.

The value can be viewed by the 'envstat -D' command.
2007-11-16 08:01:37 +00:00
xtraeme 4e10a84855 - Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
  it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
  condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
  sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
  If the acadapter is not ready, trust the state returned by the battery
  device.

Based on suggestion from joerg@.
2007-11-03 23:05:21 +00:00
xtraeme b1afa665db Mention coretemp(4). 2007-10-29 01:00:52 +00:00
wiz c06a095415 Various improvements: typo fixes, wording, formatting. 2007-10-25 23:14:41 +00:00
xtraeme 2e75cc0f7b - Do not allow a 'critical-{max,min}' property in battery
sensors (those that contain the 'want-percentage' object on its
  dictionary), the 'critical-capacity' prop must be used instead.

- When setting a 'critical-{max,min}' property check if the value is
  higher than the 'max-value' or lower than the 'min-value' on its
  dictionary, raise an error if it's true.
2007-10-09 08:00:46 +00:00
xtraeme eed1cc9bc8 Fix a typo that prevented a 'critical-capacity' property to
be added.
2007-10-09 02:29:37 +00:00
xtraeme 032cb27052 Another comment that is no more thanks to the new configuration file. 2007-10-07 18:22:37 +00:00
xtraeme 0d2161c8c4 Modify a comment that is not valid anymore. 2007-10-07 18:14:20 +00:00
xtraeme 12b91c398d If a critical-capacity property is found, make sure that the
'monitoring-supported' object is true.
2007-10-07 16:22:37 +00:00
xtraeme 1e1df7f7b4 Provide a more complete syntax example. 2007-10-07 15:37:30 +00:00
xtraeme 71045d13c0 Explain some more about the events that will send to powerd(8)
(if running) in the critical-{capacity,max,min} properties when the
limit has been reached.
2007-10-07 15:23:41 +00:00
xtraeme 2839febced Use two global dictionaries rather than only one:
- use one for temporary sensor dictionaries.
- use one as the dictionary that will be returned to send_dictionary().

This fixes multiple settings in multiple devices.
2007-10-07 13:48:03 +00:00
xtraeme 8259fb204b Use another main rule to avoid a conflict in the grammar.
Suggestion from martin@.
2007-10-07 13:46:22 +00:00
xtraeme 7447ac47db Xref envsys.conf(5) 2007-10-07 12:43:19 +00:00
xtraeme bca7b7f673 Pass -I${.CURDIR} -I. like others do. 2007-10-07 12:19:37 +00:00
xtraeme b0a8720beb Accept '+' or '-' characters at the start of SP_STRING. 2007-10-07 05:11:08 +00:00
xtraeme f2803256d9 New configuration file format for the envsys framework:
foo0 {
	#
	# CPU Temperature
	#
	sensor0 {
		critical-max = 70C;
		critical-min = 20C;
	}
	...
}
...

Removed the -m flag that was previously used to set properties for
sensors. Now the -c flag will process all properties specified in
the file (accepted as argument).

To remove all properties that were set, the new -S flag can be used.
This will restore default values for all devices.
2007-10-07 04:16:47 +00:00
xtraeme ccaf6fc177 - Simplify find_sensors().
- Remove a block that is not used anymore in check_sensors().
2007-09-25 15:09:32 +00:00
xtraeme 9df195ed98 Merge a patch from Iain Hibbert (plunky@):
- some unclear language cleaned up
- inconsistent usage of 'device' and 'driver' to refer to the same thing
- difficult error handling

And print the device name if -d flag is not specified for any driver
registered, e.g:

$ envstat
[aiboost0]
  CPU Temperature:     36.000 degC  max:   70.000 degC  min:   15.000 degC
   MB Temperature:     38.000 degC  max:   50.000 degC  min:   15.000 degC
    Vcore Voltage:      1.232 V     max:    1.350 V     min:    1.150 V
     +3.3 Voltage:      3.264 V     max:    3.500 V     min:    3.000 V
       +5 Voltage:      5.017 V     max:    5.600 V     min:    4.500 V
      +12 Voltage:     11.932 V     max:   13.500 V     min:   11.200 V
    CPU FAN Speed:       1268 RPM
$
2007-09-25 14:20:48 +00:00
plunky 3b0395d28d replace inadvertently removed N 2007-09-20 19:48:26 +00:00
plunky c231a9012a sort options 2007-09-20 18:38:49 +00:00
xtraeme 3f2361dc7d Mention aps(4). 2007-09-11 21:47:37 +00:00
xtraeme e4ac7a291b Another typo in a comment. 2007-09-10 17:41:26 +00:00
xtraeme 6f1f4d144f Fix a comment. 2007-09-10 17:40:44 +00:00
xtraeme 5316ee99b1 Check argc before calling open(2), and use the out label in another
error case.
2007-09-10 17:39:14 +00:00
xtraeme fc321f6650 Fix a lint(1) warning and remove oldsize in print_sensors(), it's
not used.
2007-09-10 14:25:17 +00:00
xtraeme 25be892bac Don't forget to check if -s was specified without -d, and add a macro
to check it in two places.
2007-09-10 14:15:11 +00:00
xtraeme 16f28d90fc Redo how the arguments are processed, so that arguments not allowed
will call usage(). Also remove an extra free().
2007-09-10 13:58:50 +00:00
xtraeme 6263ca5fa3 Update to match current kernel code. 2007-09-04 16:54:37 +00:00
xtraeme 85f08bb0ab Fix typo in previous. 2007-09-02 21:31:24 +00:00
xtraeme 13af8b9adc Add the -I flag that skips sensors with invalid state. They are shown
by default, but this is for users that don't want to print them.
2007-09-02 21:25:24 +00:00
xtraeme 1b3709ecde Add a new sensor type to sysmon_envsys(9): ENVSYS_GSTRING.
ENVSYS_GSTRING (aka Generic String) uses the genstr member in
the envsys_data_t struct to add a generic string that envstat(8)
will show as value or state.

It's like the ENVSYS_DRIVER, but doesn't use value_cur. Below
is the dictionary created on these sensors:

<dict>
	<key>description</key>
	<string>acpibat0 charge state</string>
	<key>generic-state-string</key>
	<string>NORMAL</string>
	<key>monitoring-supported</key>
	<false/>
	<key>state</key>
	<string>valid</string>
	<key>type</key>
	<string>Generic string</string>
</dict>

Note that it's limited to 32 chars, but we can grow it if needed.

envstat(8) will print ENVSYS_GSTRING sensors as:

$ envstat -dacpibat0 -s"acpibat0 charge state"
  acpibat0 charge state:     NORMAL
$
2007-09-02 19:36:59 +00:00
xtraeme 769bd9886e In temperature sensors, do not convert to degC or degF if there's
no value returned.
2007-08-29 16:55:17 +00:00