i believe that the patch for net-snmp debian bug #575810 should have included:
-+ (subfeature->mapping == 0) && ++ (subfeature->type == (feature->type << 8)) && i agree with the bug report that "subfeature->mapping == 0" causes snmpd to only report the first feature, but the suggested/accepted patch causes all subfeatures of all features to be reported, which is definitely not the historical (ie debian lenny & ubuntu hardy) behavior of snmpd. now every subfeature (eg fan1_input, fan1_min, fan1_div & fan1_alarm) of every feature (eg fan1) is reported, and to a casual observer they are indistinguishable in the snmpd output because they are only identified with the feature's name (eg "fan1"; ie "label = sensors_get_label(chip, feature)"). what i believe was intended by the original code (ie "subfeature->mapping == 0") was that only the first subfeature of each feature would be reported (eg fan1_input), because that's the historical output of snmpd and the primary output of the sensors command (eg the other subfeatures are printed following fan1_input and within parens). a quick "hack" to enable that functionality is "subfeature->type == (feature->type << 8)". this is based off how sensors.h (lines 148-204) spaces the subfeatures (line 148: "All the sensor types (in, fan, temp, vid) are a multiple of 0x100 apart") and how that is based off the associated feature (line 151: "SENSORS_SUBFEATURE_IN_INPUT = SENSORS_FEATURE_IN << 8"). a more thorough patch would probably be logic similar to the sensors command (ie for every feature [fan1] query what type it is [SENSORS_FEATURE_FAN] and pull the appropriate subfeature by name [SENSORS_SUBFEATURE_FAN_INPUT]), but that patch is much more invasive, though it would also eliminate the imperfect guessing of feature type by label (ie lmSensors.c, lines 973-996; eg "if (strstr(label, "V")) type = VOLT_TYPE;"). the attached files show the "bad" snmpwalk output of the proposed (and apparently accepted in maverick) patch and the "good" snmpwalk output of my proposed patch (which is also attached as a patch to 60_libsensors_api.patch). -- snmp-net not working with lm-sensors https://bugs.launchpad.net/bugs/506865 You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to net-snmp in ubuntu. -- Ubuntu-server-bugs mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
