ucd/net-SNMP lmSensors -- update November 11, 2010

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

Well apparently the data queries weren't included

I've uploaded a new tar.gz file which has the data query exports (and which include the one-off graphs as dependencies), the 8x graphs as separate exports, and the needed script.

Import the XML files, copy the script to cacti/scripts/, add the data queries to the target device and you should be good.
User avatar
Cornfed
Posts: 12
Joined: Thu Feb 24, 2005 11:02 am
Location: MA

Post by Cornfed »

The queries show up, but I'm getting this:

Code: Select all


+ Running data query [11].
+ Found type = '4 '[script query].
+ Could not find data query XML file at '/data/cacti/resource/script_queries/lmsensors_fan.xml'
+ Error parsing XML file into an array.
+ Could not find data query XML file at '/data/cacti/resource/script_queries/lmsensors_fan.xml'
+ Could not find data query XML file at '/data/cacti/resource/script_queries/lmsensors_fan.xml'
+ Could not find data query XML file at '/data/cacti/resource/script_queries/lmsensors_fan.xml'

Clicking on the data query for more info gives me the screenshot
Attachments
xml-error.jpg
xml-error.jpg (19.02 KiB) Viewed 23132 times
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

Okay I updated the archive again

1) use the "Import Templates" menu to import the XML files in the
templates directory

2) manually copy the XML files in the script_queries directory to
$cacti/resource/script_queries/

3) manualy copy the php scripts in the scripts directory to
$cacti/scripts/
User avatar
Cornfed
Posts: 12
Joined: Thu Feb 24, 2005 11:02 am
Location: MA

Post by Cornfed »

Perfect!! I'm in!

Thank you!!
User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

Post by Instigater »

I have tested lm_sensors on IBM x306. Some voltages and all fans are totaly incorrect.

Code: Select all

testinstall ~ # sensors
smsc47m1-isa-0500
Adapter: ISA adapter

adt7463-i2c-4-2e
Adapter: SMBus I801 adapter at 1440
V1.5:      +3.099 V  (min =  +0.00 V, max =  +3.32 V)
VCore:     +1.298 V  (min =  +1.10 V, max =  +1.47 V)
V3.3:      +3.313 V  (min =  +3.15 V, max =  +3.49 V)
V5:       +5.117 V  (min =  +0.00 V, max =  +6.64 V)
V12:      +0.156 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:   9215 RPM  (min =  875 RPM)
fan2:      8837 RPM  (min =  875 RPM)
fan3:      2410 RPM  (min =  875 RPM)
fan4:      9608 RPM  (min =  875 RPM)
CPU:      +25.00 C  (low  =    +0 C, high =   +45 C)
Board:    +20.50 C  (low  =    +0 C, high =   +70 C)
Remote:   +49.00 C  (low  =    +0 C, high =   +70 C)
CPU_PWM:    87
Fan2_PWM:   88
Fan3_PWM:   88
vid:      +1.387 V  (VRM Version 10.0)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Instigater wrote:I have tested lm_sensors on IBM x306. Some voltages and all fans are totaly incorrect.

Code: Select all

testinstall ~ # sensors
smsc47m1-isa-0500
Adapter: ISA adapter


adt7463-i2c-4-2e
Adapter: SMBus I801 adapter at 1440
V1.5:      +3.099 V  (min =  +0.00 V, max =  +3.32 V)
VCore:     +1.298 V  (min =  +1.10 V, max =  +1.47 V)
V3.3:      +3.313 V  (min =  +3.15 V, max =  +3.49 V)
V5:       +5.117 V  (min =  +0.00 V, max =  +6.64 V)
V12:      +0.156 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:   9215 RPM  (min =  875 RPM)
fan2:      8837 RPM  (min =  875 RPM)
fan3:      2410 RPM  (min =  875 RPM)
fan4:      9608 RPM  (min =  875 RPM)
CPU:      +25.00 C  (low  =    +0 C, high =   +45 C)
Board:    +20.50 C  (low  =    +0 C, high =   +70 C)
Remote:   +49.00 C  (low  =    +0 C, high =   +70 C)
CPU_PWM:    87
Fan2_PWM:   88
Fan3_PWM:   88
vid:      +1.387 V  (VRM Version 10.0)
How did you get this running on an IBM system? My lmsensors refuse working on IBMs due to some BIOS overwrite "feature" somw years ago ...
Reinhard
User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

Post by Instigater »

It's on Gentoo Linux.

Basic emerge lm_sensors did the trick.
Support for all possible hardware monitoring chips was compiled as kernel modules. Also don't forget to compile I2C support too.

I believe that quite recent version of kernel and lm_sensors will work on other distros too.
Azoff
Posts: 5
Joined: Sat Dec 13, 2003 11:17 am

Post by Azoff »

I got some trouble importing cacti_graph_template_ucdnet_lmsensors_fan_sensors_8x.xml

This is the error I get:

Code: Select all

Import Results

Cacti has imported the following items:

Graph Template
[success] ucd/net - lmSensors - Fan Sensors (8x) [update]
   + Unmet Dependency: (GPRINT Preset) Exact Numbers
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item) 

What's wrong?
YoannQ
Posts: 7
Joined: Sun Mar 12, 2006 7:10 pm

Post by YoannQ »

Hi,
I have a problem with all (8x) sensors graph. (each simple graph are Ok)

For exemple, Fan Sensor :
RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Marianne - Fan Sensors" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="RPMs" \
DEF:a="/data1/vhosts/admin.xxx.net/html/cacti/rra/marianne_sensorreading_15.rrd":sensorReading:LAST \
DEF:b="/data1/vhosts/admin.xxx.net/html/cacti/rra/marianne_sensorreading_16.rrd":sensorReading:LAST \
DEF:c="/data1/vhosts/admin.xxx.net/html/cacti/rra/marianne_sensorreading_17.rrd":sensorReading:LAST \
LINE1:a#00FF00:"fan1" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:b#0000FF:"fan2" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:c#EA8F00:"fan3" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:#A150AA:"|query_sensorName|" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:#74C366:"|query_sensorName|" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:#9FA4EE:"|query_sensorName|" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:#CCBB00:"|query_sensorName|" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n" \
LINE1:#DA4725:"|query_sensorName|" \
GPRINT::LAST:"Current\:" \
GPRINT::AVERAGE:"Average\:" \
GPRINT::MIN:"Minimum\:" \
GPRINT::MAX:"Maximum\:\n"

RRDTool Says:

ERROR: can't parse ':LAST:Current\:'
Have you an idea to solve the problem ?

THk
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You have an 8x Template but only three data sources ...
Reinhard
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

hello cool script !

i have a problem after importing the templates and doing everything in place as you mentioned in the readme

the verbose data querry shows for example

+ Running data query [12].
+ Found type = '4 '[script query].
+ Found data query XML file at '/home/dmd2www/public_html/cacti-0.8.6h/resource/script_queries/lmsensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /home/dmd2www/public_html/cacti-0.8.6h/scripts/netsnmp_lmsensors.php fan localhost, cacti, 2, , , 161, 500 index'
+ Executing script query '/usr/bin/php -q /home/dmd2www/public_html/cacti-0.8.6h/scripts/netsnmp_lmsensors.php fan localhost, cacti, 2, , , 161, 500 query sensorDevice'
+ Executing script query '/usr/bin/php -q /home/dmd2www/public_html/cacti-0.8.6h/scripts/netsnmp_lmsensors.php fan localhost, cacti, 2, , , 161, 500 query sensorName'
+ Found data query XML file at '/home/dmd2www/public_html/cacti-0.8.6h/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/home/dmd2www/public_html/cacti-0.8.6h/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/home/dmd2www/public_html/cacti-0.8.6h/resource/script_queries/lmsensors_fan.xml'

but the status shows : Success [0 Items, 0 Rows]

did i lost something ?
regards
tom
http://www.lounge-radio.com/
skaag
Posts: 2
Joined: Sat May 06, 2006 5:13 pm
Contact:

Problem importing templates

Post by skaag »

I'm running version "0.8.6c-7sarge3" (Debian)
I keep getting this message whenever I try to import templates:

Error: XML: Hash version does not exist.

I really need to monitor lm-sensors... my colo has heating problems and I want to show them facts.

Is there a way to get around this?

Thanks!
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

you need to upgrade your cacti installation to version cacti-0.8.6h then the import of the templates will work.
cheers
tom
http://www.lounge-radio.com/
skaag
Posts: 2
Joined: Sat May 06, 2006 5:13 pm
Contact:

Upgraded to 0.8.6h

Post by skaag »

Ok now I am using 0.8.6h and i've copied the files again, and now i've managed to import all the templates, except for the 8x templates. I can't import the 8x templates, and i'm getting the same errors as Azoff is getting (Unmet dependencies while importing).

The simple graphs are working great now, I get all the data I need, but it would indeed be nice to have them consolidated into one graph.

Is there a solution for those dependencies?

Are the dependencies an issue of me not having all the data sources required by the graph? Or is it something else?

Skaag
Yzo
Posts: 3
Joined: Tue May 16, 2006 4:26 pm

Post by Yzo »

I'm a new Cacti user and a net-snmp lightweight. I've been spending the last two days banging my head against the wall, trying to figure out how to get this working. My apologies if this post is excessively large, I'm striving to be as detailed as possible.

For some reason I haven't been able to figure out, no RRD files are being generated when I try to get these graphs working. I'll limit my examples to the thermal sensors, but the same problem is affecting voltage and fan readings as well.

The server in question is running Gentoo. lm_sensors, net-snmp, and Cacti were all emerged in. Cacti version is 0.8.6h_p20060108-r2, lm_sensors version is 2.10.0, and net-snmp is 5.2.1.2-r1.

Cacti is polling snmp via the lo or eth0 interface. With either interface, the Cacti standard graphs in the Linux host template work, but the lmSensors graphs do not.

CLI lm_sensors works. Here's the snipped output of sensors:

Code: Select all

temp1:       +53 C  (high =   +66 C, hyst =   +16 C)   sensor = thermistor      
temp2:     +52.0 C  (high =   +85 C, hyst =   +80 C)   sensor = diode           (beep)
temp3:     +41.0 C  (high =   +85 C, hyst =   +80 C)   sensor = thermistor      
CLI snmpwalk returns sensors readings. Here's that snipped output:

Code: Select all

$snmpwalk -c sakura -v1 localhost tempsensors
LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 2
LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: temp1
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: temp2
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: temp3
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 53000
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 53000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 41000
I've got the requisite XML files and php scripts where they need to be according to the README. I import the thermal sensor data query template and the single sensor graph template. So far, so good.

I add the lmSensor data query to the device. Seems to be working. The status says "Success [6 Items, 3 Rows]". Here's the output of verbose query:

Code: Select all

+ Running data query [14].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php temperature 10.0.0.2, sakura, 1, , , 161, 500 index'
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php temperature 10.0.0.2, sakura, 1, , , 161, 500 query sensorDevice'
+ Found item [sensorDevice='1'] index: 1
+ Found item [sensorDevice='2'] index: 2
+ Found item [sensorDevice='3'] index: 3
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php temperature 10.0.0.2, sakura, 1, , , 161, 500 query sensorName'
+ Found item [sensorName='temp1'] index: 1
+ Found item [sensorName='temp2'] index: 2
+ Found item [sensorName='temp3'] index: 3
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_temp.xml'
I interpret that to mean it found the thermal sensors. So I go to create graphs for the host.

Image

So now I've got three thermal sensor entries in the data sources tab, and three thermal sensor entries in graph management. Up to this point, I'm assuming everything is setup the way it supposed to be.

At this point though, I hit trouble. None of the rrd files listed in the data sources ever get generated. Here's the debug output for the temp1 sensor:

Code: Select all

/usr/bin/rrdtool create \
/var/www/localhost/htdocs/cacti/rra/hostnet_sensorreading_65.rrd \
--step 300  \
DS:sensorReading:GAUGE:600:0:150 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
Obviously, if no rrd file is created, I'll get no graph output as indicated by the temp1 graph debug:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="host-net - Thermal Sensor - temp1" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Celsius" \
--slope-mode \
DEF:a="/var/www/localhost/htdocs/cacti/rra/hostnet_sensorreading_65.rrd":sensorReading:AVERAGE \
LINE2:a#0000FF:"temp1"  \
GPRINT:a:LAST:"Current\:%8.2lf%s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s\n" 

RRDTool Says:

ERROR: opening '/var/www/localhost/htdocs/cacti/rra/hostnet_sensorreading_65.rrd': No such file or directory
If I manually su to the apache user account and run the "rrdtool create" command above, I'll get an rrd file which when graphed results in a graph with no data. The values will be reported as "nan".

It looks for the world like cmd.php isn't even polling the information like it should. I created a device entry that contained only the lmSensors data queries and the associated graphs. Cmd.php logs the following (This is with logging set to HIGH and with poller logging Errors, Warnings, and Statistics):

Code: Select all

apache$ /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php

05/16/2006 03:30:46 PM - CMDPHP: Poller[0] ERROR: Either there are no items in the cache or polling is disabled
05/16/2006 03:30:47 PM - SYSTEM STATS: Time:1.0535 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:0 RRDsProcessed:0
Quite honestly, I'm a little out of my league when it comes to rrdtool and snmp. As far as I can see, it looks for the world like it should be working.

It's not a permissions problem, as I said, there's no problem with the data for memory usage, interface statistics, etc being written out and graphed.

Can anyone help?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests