Our lmSensors MIB implementation(s) does not handle well multiple
sensors with the same name. It simply ignores some of them.

E.g. I have HW with two Xeon E7520 CPUs. lm_sensors says following:

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +41.0°C  (high = +75.0°C, crit = +91.0°C)
Core 3:      +46.0°C  (high = +75.0°C, crit = +91.0°C)
Core 8:      +44.0°C  (high = +75.0°C, crit = +91.0°C)
Core 11:     +43.0°C  (high = +75.0°C, crit = +91.0°C)

coretemp-isa-0004
Adapter: ISA adapter
Core 0:      +39.0°C  (high = +75.0°C, crit = +91.0°C)
Core 3:      +41.0°C  (high = +75.0°C, crit = +91.0°C)
Core 8:      +43.0°C  (high = +75.0°C, crit = +91.0°C)
Core 11:     +41.0°C  (high = +75.0°C, crit = +91.0°C)

Note that there are two sensors with label "Core 0", each on different
chip. 'snmpwalk lmSensors' just shows the last one found:
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: Core 0
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: Core 3
LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: Core 8
LM-SENSORS-MIB::lmTempSensorsDevice.5 = STRING: Core 11

The reason is that lmsensors_v3.c expects that the label is unique. It
is clearly not in my case. I have couple of ideas how to fix it and I
will contribute the code once we agree on a solution.


Solution 1:
Always prefix sensor label with a chip name, like
"coretemp-isa-0004:Core 0". This is unique, but it will change values of
lmTempSensorsDevice. Some applications might not be happy about that.

lmTempSensorsDevice.2 = STRING: coretemp-isa-0000:Core 0
lmTempSensorsDevice.3 = STRING: coretemp-isa-0000:Core 3
lmTempSensorsDevice.4 = STRING: coretemp-isa-0000:Core 8
lmTempSensorsDevice.5 = STRING: coretemp-isa-0000:Core 11
lmTempSensorsDevice.6 = STRING: coretemp-isa-0004:Core 0
lmTempSensorsDevice.7 = STRING: coretemp-isa-0004:Core 3
lmTempSensorsDevice.8 = STRING: coretemp-isa-0004:Core 8
lmTempSensorsDevice.9 = STRING: coretemp-isa-0004:Core 11


Solution 1.5:
Add a new config option to turn the prefixing on/off.


Solution 2:
Keep current behaviour and only when duplicate labels are detected,
prefix the later ones to keep them unique.

lmTempSensorsDevice.2 = STRING: Core 0
lmTempSensorsDevice.3 = STRING: Core 3
lmTempSensorsDevice.4 = STRING: Core 8
lmTempSensorsDevice.5 = STRING: Core 11
lmTempSensorsDevice.6 = STRING: coretemp-isa-0004:Core 0
lmTempSensorsDevice.7 = STRING: coretemp-isa-0004:Core 3
lmTempSensorsDevice.8 = STRING: coretemp-isa-0004:Core 8
lmTempSensorsDevice.9 = STRING: coretemp-isa-0004:Core 11

This looks ugly, some of the labels are not prefixed, some are, but it
won't harm existing applications.


Solution 3:
Completely rewrite agent/mibgroup/hardware/sensors/*. lmTempSensorsValue
does not need to be unique from MIB point of view, just our
implementation requires it. I am afraid I cannot provide the code in
this case, it's way over my time I can spend on net-snmp.

Any other suggestions?

Jan

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to