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:

On Sun, Aug 26, 2012 at 11:47:46AM -0700, Paul Goyette wrote:
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.

So we can't mention if a value is critical or not ?

Not currently.

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.)

Well, in the case of the BBU it would be better to display good or bad.
ABSENT would be misleading, becase what we really want to report
is that the BBU is present but bad.

I'm sure we could come up with dozens of pairs of values, GOOD/BAD,
TRUE/FALSE, PRESENT/ABSENT, CRITICAL/NORMAL, ...

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.

But then what would envstat report ?

It would just show the integer value 0 or 1. You can see an example using swsensor(4):

        modload -s type=Integer swsensor
        envstat -d swsensor
        modunload swsensor

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

I think we need a general-purpose boolean sensor.

It seems that envstat(8) already thinks that INDICATOR is a boolean. It reports values of TRUE and FALSE.


It would be fairly easy to report changes in INDICATOR sensors, it's just a matter of what words to use in the reports!


-------------------------------------------------------------------------
| 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