Alexander Leidinger

Just another weblog

Dec
06

FreeNAS & Sen­sors for FreeBSD

This WE I was told that FreeNAS seems to want to move from FreeBSD to Linux (since then it seems there could be a linux and a FreeBSD ver­sion). One of the rea­sons seems to be a miss­ing sen­sors framework.

As I was com­mit­ting a port of the OpenBSD sen­sors frame­work (pro­duced as part of the Google Sum­mer of Code 2007) to FreeBSD and had to remove it after­wards because one com­mit­ter com­plained very loudly, I was asked what the sta­tus of this is.

The short sta­tus is: Nobody is doing some­thing about it.

Before I explain the long sta­tus, I give  a short overview what this sen­sors frame­work is:

  • a ker­nel API which allows to add sensors
  • an inter­face for the user­land to query the sen­sor data
  • some basic user­land code to show and log the sen­sor info

The API and the query inter­face are more or less inde­pen­dent. For the user­land code it was more a log­ging infra­struc­ture than a real mon­i­tor­ing solu­tion. The rea­son was the real mon­i­tor­ing solu­tions already exist (Nagios, snmpd, …) and can be adapted to query the sen­sors. Ide­ally a query in user­land should be han­dled by a library instead of directly access­ing the sysctl inter­face, this way the kernel<->userland inter­face would be abstracted away (and could b replaced as needs arise). This was not done, it was some­thing to be done later (Rome was not build in a day).

The user­land inter­face also only cared about dumb sen­sors (those which you need to query man­u­ally to get the infor­ma­tion), smart sen­sors (those which are able to send events them­self) where not taken care about in the sense of really send­ing sensor-triggered events, but the ker­nel API allowed to add such sen­sors. The sysctl inter­face has no way of send­ing events, but FreeBSD already has an event inter­face (devd is tak­ing care about it). It would have been not a prob­lem to send events via this chan­nel and let an user­land library take care about the deliv­ery together with other sensor-data in userland.

And now the long sta­tus is:

PHK com­plained loudly about it. First he said he did not look at it but he com­plained that is not good regard­less. After a lot of nag­ging from me he had a look at it and was not happy about the time stuff in it (short: the FreeBSD time­counter code is bet­ter). This was not a prob­lem in my opin­ion, we could have dis­abled this part with­out prob­lems. After such an offer from me, he com­plained that the sen­sors frame­work uses the sysctl inter­face instead of an entry in /dev.

At this point in time already sev­eral user­land util­i­ties used the sysctl frame­work to query for sta­tus data in the ker­nel. So there was already prece­dence for such an use of it. Later some more such uses where added too (e.g. the proc­stat stuff by core team mem­ber Robert Watson).

I saved some of the cor­re­spond­ing mails (to pub­lic mail­ing lists) in a mbox file, read the mess your­self if you want.

The bot­tom line is: Sev­eral com­mit­ters (even some which we could call high pro­file com­mit­ters) told me that they do not see a prob­lem in the use of the sysctl inter­face. They do not seem to want to tell it in pub­lic (nobody of them voiced their opin­ion in the thread, so do not ask me who those peo­ple are). I am not inter­ested in invest­ing more of my spare time into fight­ing wind­mills (it looks like this to me).

So, if some­one is inter­sted in the code, r172631 has it. In the per­force repos­i­tory you can maybe find some sen­sors. I think most of it can still be used with­out much changes.

If some­one tries it with a more recent FreeBSD, please drop me a note if it just applies fine, or a patch (or an URL to it) if it needs some mod­i­fi­ca­tions. Who knows, maybe in a future project it may be use­ful for me.

If there is enough inter­est by sev­eral peo­ple, I can even put up a wiki page where those peo­ple can coor­di­nate, but that is most prob­a­bly all I am will­ing to invest fur­ther into this (at least in my unpaid time).

GD Star Rat­ing
load­ing…
GD Star Rat­ing
load­ing…
FreeNAS & Sen­sors for FreeBSD, 6.9 out of 10 based on 7 ratings
Tags: , , , , , , , , ,

12 Responses to “FreeNAS & Sen­sors for FreeBSD”

  1. harris Says:

    Thanks for your work, I hope your code to be merged back to FreeBSD.

    Not hav­ing sen­sors sup­port it is a major luck of func­tion­al­ity and I surely under­stand the rea­sons of the migra­tion of freenas to linux.

    I am an sysad­min and I want to know all the time what hap­pens to the inner of the servers case’s.
    For this rea­son I have migrated sev­eral servers from FreeBSD to Linux because know­ing the oper­a­tion states of sev­eral hard­ware pieces it is cru­cial and manda­tory for sysad­mins for the server avail­abil­ity and over­all secu­rity architecture.

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  2. FreeNAS, de BSD à Linux ? at FreeBSD-fr: Les nouvelles du géant en français Says:

    […] cette his­toire à finale­ment fait pas mal de bruit, per­mis de réou­vrir d’anciennes plaies,  mais c’est avant tout la com­mu­nauté des util­isa­teurs de FreeNAS, qui par son attachement […]

  3. plouf le chien Says:

    PHK com­plained loudly” : per­haps freebsd team should exclude this peo­ple : We are all wait­ing for “sen­sors” for a real long time. PHK cost us much more than just than “hey look at freebsd, they even lost freenas”. I’m using FreeBSD for more than a decade, not only I dis­cov­ered today that the major thing miss­ing for mon­i­tor­ing my cus­tomers had been voided by a sort of elit­ist com­miter, but also that the com­mu­nity had lost one of the too main projects..
    They’re is only one way to go for­ward, put back your code into the tree. In real life, noth­ing is “freezed”, even if your code was really “bad”, any­body can rewrite the bad parts; that’s the way open­source works.…
    (Sorry for my poor english)

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  4. FreeNAS ateitis | FreeBSD.lt Says:

    […] Plačiau […]

  5. Olivier Cochard-Labbe Says:

    Sen­sor sup­port is a “small” prob­lem for me: What I don’t under­stand is why the FreeBSD team refuse to include the geom_raid5 mod­ule used in FreeNAS !
    The exist­ing geom_vinum mod­ule included in FreeBSD 6/7 is too buggy for RAID 5: This is why FreeNAS uses another not-official more sta­ble geom mod­ule. But this mod­ule was never accepted to be included in FreeBSD. Now the orig­i­nal devel­oper of geom_raid5 stop to main­tains it (dis­cour­aged), and it’s very hard to found some­one to adapt it to FreeBSD 8.0.

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  6. netchild Says:

    AFAIK geom_vinum was updated for FreeBSD-8. I can not remem­ber to have seen a post about geom_raid5 on current@ or hackers@. Do you have a pointer to a dis­cus­sion regard­ing this on a pub­lic FreeBSD-mailinglist? If this was not dis­cussed on a FreeBSD mail­inglist, I sug­gest to start a dis­cus­sion there.

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  7. passerby Says:

    1. FreeNAS is not “mov­ing to Linux” — yes there’s a new project core­NAS that will. But I hope any­one who decides to change under­ly­ing plat­forms to use Linux is doing so for more rea­sons than just the sen­sor frame­work. Any­way core­NAS will be one of dozens of Linux NAS projects. We use FreeNAS specif­i­cally to lever­age FreeBSD stor­age tech­nolo­gies (gjour­nal, iscsi, zfs) and have learned enough through cus­tomiza­tion that we will just stick with FreeBSD if FreeNAS ever goes away (and right now it is not).

    2. PHK is not just “some elit­ist com­mit­ter”, sheesh. If PHK has con­cerns about impact on the ker­nel we should stop and lis­ten — his vote gives him the abil­ity to make peo­ple stop and lis­ten. He might be a bit Dan­ish in his direct­ness but not every­one can be the diplo­mat a la RWat­son. PHK was given his vote for a rea­son so there’s no rea­son for acri­mony. Whats more he is not the only per­son who has prob­lems with the OpenBSD sen­sor frame­work. It’s not 100% loved amongst OpenBSD devs and users (using it for RAID is going to be a problem).

    3. It’s great that con­stan­tine and alex did this work. If it is truly “non-disruptive” and can be sep­a­rated from the ker­nel then why not just main­tain it as a port/patch. Lots of ports of things that never make it into the ker­nel live on and do all kinds of stuff like build­ing cus­tom ker­nel mod­ules and user space tools for man­ag­ing them­selves. If the sen­sors frame­work can’t do that then per­haps it is too dis­rup­tive to include by default.

    I bet if you main­tain a patch on CURRENT tar­get­ting 9.0 and lots of peo­ple will try it.

    4. it might not seem like it but it’s still early days … :)

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  8. Olivier Cochard-Labbe Says:

    The dis­cus­sion began the 06 Nov 2007 on the FreeBSD cur­rent mailing-list:
    http://unix.derkeiler.com/Mailing-Lists/FreeBSD/current/2007 – 11/msg00342.html

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  9. netchild Says:

    It looks like the dis­cus­sion stops in the mid­dle of resolv­ing some issues. BTW: the devel­oper inter­ested in get­ting this in the tree (Ulf) is also the geam_vinum developer.

    As it looks to me after read­ing the thread, that some impor­tant work needs to be done before it can go in.

    Maybe you want to con­tact lulf@ to know if there where some parts han­dled off-list and what the sta­tus of it is.

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  10. avg Says:

    Just wanted to drop a line that cou­ple of month ago I adapted sen­sors code to head ver­sion of FreeBSD and I’ve been using it since then. I am using only it(4) dri­ver though, and not doing any­thing fancy.
    As such I made cou­ple of small improve­ments to it(4), includ­ing sup­port for 16-bit fan speed coun­ters.
    Here’s my cur­rent diff against head:
    http://people.freebsd.org/~avg/sensors9.diff

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  11. ackstorm Says:

    This is infu­ri­at­ing, espe­cially now that the coretemp mod­ule reports it’s tem­per­a­tures in sysctl

    Has any­one taken it upon them­selves to get this merged into 8.2?

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  12. Why FreeBSD does not have temperature/fan/voltage sensors | dissident bytes in the ackstorm Says:

    […] If you want to the devel­op­ers story, or you want to pick up the lat­est code and port it your­self, you can find it here […]

Leave a Reply