Monday, December 1, 2008

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.

8 Comments:

At December 1, 2008 at 11:42 PM , Blogger p-brane said...

Would be nice to contribute your documentation back to the project.

 
At December 1, 2008 at 11:43 PM , Blogger p-brane said...

FYI, nice looking graphs, btw 8-)

 
At December 7, 2008 at 6:51 PM , Blogger aswantara said...

@p-brane:
thank you.
think that what i do is just a simple one. But, i'll try to contribute to the project.
Once again, thank's.

 
At March 10, 2009 at 11:04 PM , Blogger Stavros Vologiannidis said...

Is it possible to publish fragments of your datacollection-config.xml and snmp-graph.properties?

 
At March 23, 2009 at 8:36 PM , Blogger aswantara said...

sure.
but, format is xml, and can't publish in blogspot, bcoz blogspot using xml too..

 
At March 23, 2009 at 10:06 PM , Blogger Stavros Vologiannidis said...

Send it to svologia at gmail if you want. Thank you very much

 
At March 26, 2009 at 1:43 AM , Blogger Unknown said...

Thanks for your post! It helps me a lot. Would you like to mail me (jhe_408@yahoo.com) the snmp-graph.properties for the first display? I am working on a similar stuff.

 
At March 29, 2009 at 4:08 PM , Blogger aswantara said...

sorry, soon i will post it at my friend blog, because many person want me to send.. I will ask my friend to post it.
Thx.

my friend blog :http://findyourfree.blogspot.com

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home