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



I've just committed a few changes that should enable you to do what you wanted. With appropriate use of both FMONSTATECHANGED and FMONCRITICAL you can achieve the tri-state values of ABSENT/WORKING/FAILED.

I'll be adding a couple of additional test cases for swsensor to make sure that this capability doesn't break in the future.

Please note:

Although the code currently does not check or complain, it is not valid for a sensor to have both FMONCRITICAL and FMONLIMITS. Both of these monitor-events try to use the edata->state value, and will overwrite each other.

This is on my list of things to fix "when I get around to it".   :)



On Sun, 26 Aug 2012, Manuel Bouyer wrote:

On Sun, Aug 26, 2012 at 12:24:33PM -0700, Paul Goyette wrote:
So we can't mention if a value is critical or not ?

Not currently.

How hard would it be to change that ?

[...]
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, ...

I would exclude CRITICAL/NORMAL from the list: there is another
flag (ENVSYS_SCRITICAL) to say if a sensor is in critical condition,
regardless of its value. I guess we can just let the driver set it,
in addition to the boolean value.


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

I fear this would be more confusing to user than the current
TRUE/FALSE report.


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!

I guess TRUE/FALSE would be good enough.

--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
    NetBSD: 26 ans d'experience feront toujours la difference
--

!DSPAM:503a96ea33031234514069!



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