How to collect and preview the data from LM-SENSOR using OpenNMS
OpenNMS in standard can’t collect the data from LM-SENSORS, even the lmsensors can collect the data from the node that installed. So, to collect the data from lmsensors using opennms, we must add some definition in datacollection.xml in opennms folder. Here, I’m using OpenNMS 1.5.91 based on Ubuntu 7.10 Gutsy Gibbon, and I also have tried this using Ubuntu 8.04 Hardy Heron.
In this project I want to collect the data using lmsensors (temperature and voltage) of VIA EPIA Mini ITX ML6000EA and Soekris Net 4801.
For the first time, we must installed SNMP agent in each node, and make sure that the SNMP agent run finely in each node.
And then, we installed lm-sensors in each node. After installing lm-sensors, check whether lm-sensors can get data from that node using command #sensors -s && sensors. The output is like this:
root@ubuntuvia:/home/labngn# sensors
vt1211-isa-6000
Adapter: ISA adapter
+3.3V: +3.39 V (min = +0.00 V, max = +4.42 V)
+2.5V: +2.49 V (min = +0.00 V, max = +3.16 V)
VCore: +1.03 V (min = +0.00 V, max = +2.63 V)
+5V: +4.71 V (min = +0.00 V, max = +6.31 V)
+12V: +11.90 V (min = +0.00 V, max = +14.99 V)
+3.3V: +3.30 V (min = +3.13 V, max = +3.46 V)
Case Fan: 0 RPM (min = 0 RPM, div = 2)
CPU Fan: 0 RPM (min = 0 RPM, div = 2)
CPU Temp: +26.4°C (high = +190°C, hyst = -78°C)
Int Temp: +40.0°C (high = +204°C, hyst = +0°C)
vid: +1.750 V (VRM Version 1.7)

To check the SNMP and lm-sensors run correctly, just using command #snmpwalk -v1 -c public (your node’s IP) .1.3.6.1.4.1.2021.13.16. Here is the example of the output:
LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: CPU Temp
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: Int Temp
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 32673
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 41000
LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: Case Fan
LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: CPU Fan
LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 0
LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 0
LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 2
LM-SENSORS-MIB::lmVoltSensorsIndex.4 = INTEGER: 3
LM-SENSORS-MIB::lmVoltSensorsIndex.5 = INTEGER: 4
LM-SENSORS-MIB::lmVoltSensorsIndex.6 = INTEGER: 5
LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: +3.3V
LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: +2.5V
LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: VCore
LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: +5V
LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: +12V
LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: +3.3V
LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 3385
LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 2480
LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 1032
LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 4708
LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 11901
LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 3298
LM-SENSORS-MIB::lmMiscSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmMiscSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmMiscSensorsIndex.3 = INTEGER: 2
LM-SENSORS-MIB::lmMiscSensorsDevice.1 = STRING: alarms
LM-SENSORS-MIB::lmMiscSensorsDevice.2 = STRING: vid
LM-SENSORS-MIB::lmMiscSensorsDevice.3 = STRING: vrm
LM-SENSORS-MIB::lmMiscSensorsValue.1 = Gauge32: 4608000
LM-SENSORS-MIB::lmMiscSensorsValue.2 = Gauge32: 1750
LM-SENSORS-MIB::lmMiscSensorsValue.3 = Gauge32: 1699
After that, we must add resource type in datacollection.xml in opennms directory (/etc/opennms).
Ans then, add group name for this resource type:
After that, we must define the resource type and group name in the Sysdef of the OpenNMS, like this:
.1.3.6.1.4.1.8072.3.2.10
lmSensors-temperature
lmSensors-fan
lmSensors-volt
lmSensors-misc
Basically, OpenNMS can’t define the SNMP graph for lm-sensors, so we must define the graph manually in the snmp-graph.properties directory, here is the example of the definition for temperature:
report.lmsensors.temperature.name=Temperature
report.lmsensors.temperature.columns=temp1
report.lmsensors.temperature.propertiesValues=temp
report.lmsensors.temperature.type=lmTempSensorsTable
report.lmsensors.temperature.command=–title=”Temperature on {temp}” \
–vertical-label=”Celcius” \
DEF:dCore={rrd1}:temp1:AVERAGE \
CDEF:bCore=dCore,1000,* \
LINE2:bCore#0000ff:”Temperature Core:” \
GPRINT:bCore:AVERAGE:” Avg \\: %10.2lf %s” \
GPRINT:bCore:MIN:”Min \\: %10.2lf %s” \
GPRINT:bCore:MAX:”Max \\: %10.2lf %s\\n” \
And then, if we check in the OpenNMS web, here is the display:

And here is the display of the graph:

That’s all. Simple. Good Luck.



Thanks for this info. Helped me setting up monitoring lm-sensors.
Hi, I´m trying to set another device in my network. And it has been very tough. Is it possyble to you, send me your xml files so that the steps you described got really clear to me ? thanks in advance
@leonardo,
maybe you can see in my other blog,
http://aswantara.blogspot.com
maybe will be clearer..
When I run the command – #snmpwalk -v2c -c public (my node’s IP) .1.3.6.1.4.1.2021.13.16. I am getting the following error. I can see the MIB for LM -sensors in the proper directory present. Also I am getting the values from Sensors. But I am getting this error somehow:
LM-SENSORS-MIB::lmSensors = No more variables left in this MIB View (It is past the end of the MIB tree)
Sensors output:
sensors
w83793-i2c-0-2f
Adapter: SMBus I801 adapter at 1100
VCoreA: +1.12 V (min = +0.92 V, max = +1.38 V)
VCoreB: +1.24 V (min = +0.00 V, max = +2.05 V)
Vtt: +1.11 V (min = +0.99 V, max = +1.33 V)
-12V: -12.62 V (min = -13.21 V, max = -10.69 V)
VDIMM: +1.79 V (min = +1.62 V, max = +1.98 V)
+3.3V: +3.34 V (min = +2.96 V, max = +3.63 V)
+12V: +12.00 V (min = +10.75 V, max = +13.25 V)
+5V: +5.07 V (min = +4.64 V, max = +5.65 V)
5VSB: +5.07 V (min = +4.64 V, max = +5.65 V)
VBAT: +3.25 V (min = +2.96 V, max = +3.63 V)
CPU_Fan: 1967 RPM (min = 712 RPM)
CPU Temp: +33.0°C (high = +81.0°C, hyst = +76.0°C) sensor = Intel PECI
System Temp: +34.0°C (high = +50.0°C, hyst = +45.0°C) sensor = thermistor
temp6: +33.0°C (high = +50.0°C, hyst = +45.0°C) sensor = thermistor
beep_enable:disabled
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +41.0°C (high = +76.0°C, crit = +100.0°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +41.0°C (high = +76.0°C, crit = +100.0°C)
Please any help is appreciated. Thanks!
Vik