tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysmon_envsys ENVSYS_INDICATOR state change reports



On Sun, 26 Aug 2012, Manuel Bouyer wrote:

Hello,
while hacking on mfi(4), I found that, while sysmon_envsys(9) reports
state change for ENVSYS_DRIVE sensors, such as:
mfi0: normal state on 'mfi0:0' (online)
mfi0: normal state on 'mfi0:1' (online)

but it doesn't do for ENVSYS_INDICATOR sensors. All sensors starts
in state ENVSYS_SINVALID, and the status gets updated later by
calls to mfi_sensor_refresh() from sysmon_envsys.

For these sensors, status should always be SVALID or SINVALID. The status is separate from the value, which for an indicator is either 0 or 1.

Why are changes to ENVSYS_INDICATOR nor reported, and would it make
sense to have changes to ENVSYS_INDICATOR be reported too ?

It would not be too difficult to change this behavior.

Howver, what are the acceptable "values" for such an indicator? This is really a boolean, so TRUE or FALSE might be valid. But it seems that all current uses are for detecting the presence or absence of some sort of power source, so maybe PRESENT and ABSENT should be used? (The powerd(8) man page seems to indicate that valid states would be CRITICAL or NORMAL, but I don't think that makes sense.)

An easy alternative would simply to mark the sensor as an INTEGER, and only assign it values of 0 or 1. Changes in INTEGER values can be reported.

The original design seems to have assumed that INDICATOR sensors were only for system-wide power sources (AC adapters).



-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index