The current way lm_sensors reads sensor info from sysfs currently doesn't always work on recent 2.6 kernels due to way the if tests in the sensors_init function seem to interact with gcc optimisations. This problem appears if there are entries in the hwmon sysfs directory but not the i2c-adapter sysfs directory. Reproducible: Sometimes Steps to Reproduce: 1. Configure lm_sensors and net-snmp for sensor monitoring 2. Check /sys/class/i2c-adapter/ to make sure there are no entries 3. Check /sys/class/hwmon/ to make sure there are sensor entries 4. Run sensors 5. Start snmpd and run snmpwalk -v 2c -c <community> 127.0.0.1 .1.3.6.1.4.1.2021.13.16 Actual Results: lm_sensors shows the sensors output but net-snmp doesn't detect any sensors Expected Results: both lm_sensors and net-snmp should detect and show all the sensors This was tested with net-analyzer/net-snmp-5.4.1.1, sys-apps/sensors-2.10.7, and kernel: 2.6.26-hardened-r1 with sensor module: w83627ehf
Created attachment 170659 [details, diff] lm_sensors_2_read.patch This patch attempts to fix the problem by not assigning the result of both the bus reading and chip reading functions to the same variable and by reading both sensor types before checking the result.
Did you send this upstream?
No
Please do...