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.