FreeNAS & Sen­sors for FreeBSD

This WE I was told that FreeNAS seems to want to move from FreeB­SD to Lin­ux (since then it seems there could be a lin­ux and a FreeB­SD 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 OpenB­SD sen­sors frame­work (pro­duced as part of the Google Sum­mer of Code 2007) to FreeB­SD and had to remove it after­wards because one com­mit­ter com­plained very loud­ly, 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, snm­pd, …) and can be adapt­ed to query the sen­sors. Ide­al­ly a query in user­land should be han­dled by a library instead of direct­ly access­ing the sysctl inter­face, this way the kernel<->userland inter­face would be abstract­ed away (and could b replaced as needs arise). This was not done, it was some­thing to be done lat­er (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­al­ly to get the infor­ma­tion), smart sen­sors (those which are able to send events them­self) where not tak­en care about in the sense of real­ly 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 FreeB­SD 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 togeth­er with oth­er sensor-data in userland.

And now the long sta­tus is:

PHK com­plained loud­ly 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 hap­py about the time stuff in it (short: the FreeB­SD 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­er­al 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. Lat­er 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­er­al 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­est­ed 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­st­ed in the code, r172631 has it. In the per­force repos­i­to­ry 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 FreeB­SD, 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­er­al 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).

12 thoughts on “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­i­ty and I sure­ly 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 migrat­ed sev­er­al servers from FreeB­SD to Lin­ux because know­ing the oper­a­tion states of sev­er­al hard­ware pieces it is cru­cial and manda­to­ry for sysad­mins for the serv­er avail­abil­i­ty and over­all secu­ri­ty architecture.

  2. Pingback: FreeNAS, de BSD à Linux ? at FreeBSD-fr: Les nouvelles du géant en français
  3. plouf le chien says:

    PHK com­plained loud­ly” : per­haps freeb­sd 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 freeb­sd, they even lost freenas”. I’m using FreeB­SD 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 void­ed by a sort of elit­ist com­miter, but also that the com­mu­ni­ty 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 real­ly “bad”, any­body can rewrite the bad parts; that’s the way open­source works.…
    (Sor­ry for my poor english)

  4. Pingback: FreeNAS ateitis | FreeBSD.lt
  5. Sen­sor sup­port is a “small” prob­lem for me: What I don’t under­stand is why the FreeB­SD team refuse to include the geom_raid5 mod­ule used in FreeNAS !
    The exist­ing geom_vinum mod­ule includ­ed in FreeB­SD 67 is too bug­gy for RAID 5: This is why FreeNAS uses anoth­er not-official more sta­ble geom mod­ule. But this mod­ule was nev­er accept­ed to be includ­ed in FreeB­SD. Now the orig­i­nal devel­op­er of geom_raid5 stop to main­tains it (dis­cour­aged), and it’s very hard to found some­one to adapt it to FreeB­SD 8.0.

    1. netchild says:

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

  6. passerby says:

    1. FreeNAS is not “mov­ing to Lin­ux” – 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 Lin­ux is doing so for more rea­sons than just the sen­sor frame­work. Any­way core­NAS will be one of dozens of Lin­ux NAS projects. We use FreeNAS specif­i­cal­ly to lever­age FreeB­SD stor­age tech­nolo­gies (gjour­nal, isc­si, zfs) and have learned enough through cus­tomiza­tion that we will just stick with FreeB­SD 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­i­ty 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 giv­en his vote for a rea­son so there’s no rea­son for acri­mo­ny. Whats more he is not the only per­son who has prob­lems with the OpenB­SD sen­sor frame­work. It’s not 100% loved amongst OpenB­SD 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 tru­ly “non-disruptive” and can be sep­a­rat­ed from the ker­nel then why not just main­tain it as a port/patch. Lots of ports of things that nev­er 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 ear­ly days … 🙂

    1. netchild says:

      It looks like the dis­cus­sion stops in the mid­dle of resolv­ing some issues. BTW: the devel­op­er inter­est­ed 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.

  7. avg says:

    Just want­ed to drop a line that cou­ple of month ago I adapt­ed sen­sors code to head ver­sion of FreeB­SD 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 counters.
    Here’s my cur­rent diff against head:
    http://people.freebsd.org/~avg/sensors9.diff

  8. ackstorm says:

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

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

  9. Pingback: Why FreeBSD does not have temperature/fan/voltage sensors | dissident bytes in the ackstorm

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.