添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are several discussions around where people have small servers in places where it gets cold and their temperature graphs stop working or they report very very high numbers, such as:

  • LM-Sensors temperature graphs spikes and disappears with negative temperatures librenms/librenms#15609
  • https://www.reddit.com/r/LibreNMS/comments/18ah8wo/submitted_a_bug_report_any_help_from_reddit/
  • The value is gathered in netsnmp_sensor_arch_load() at

    net-snmp/agent/mibgroup/hardware/sensors/lmsensors_v3.c Lines 79 to 81 759421b

    The issue is a Gauge32 cannot show a negative number, this is what the MIB has defined for this OID so the implementation is correct as far as MIB is concerned.

    My suggestion is:

  • Update the lmSensors MIB to have an additional field, not sure if the old temperature should be deprecated.
  • Update the handler for this new field and convert it to an Integer32
  • My expectation is its a handful lines of code to do this. If the approach is ok I can even create a PR for it. I'm not sure what the mechanics are of updating the MIB though.

    The mib change would be something like:

    lmTempSensorsValue OBJECT-TYPE
        SYNTAX      Gauge32
        MAX-ACCESS  read-only
        STATUS      deprecated
        DESCRIPTION
            "The temperature of this sensor in mC.
              This object has been deprecated in favor of
              'lmTempSensorsTemperature(4), which can display
              temperatures below 0 degrees Celcius."
        ::= { lmTempSensorsEntry 3 }
    lmTempSensorsTemperature OBJECT-TYPE
        SYNTAX      Integer32
        UNITS "mCel"
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
            "The temperature of this sensor in mCel."
        ::= { lmTempSensorsEntry 4 }
    

    I changed the unit from mC to mCel to follow RFC8428 and currently, its reporting the temperature in milliCoulombs. That's a minor thing in any case.