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

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

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

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

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index