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

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

Moderators: Developers, Moderators

Post Reply
Xirss
Posts: 21
Joined: Mon May 26, 2008 7:43 am
Location: UA
Contact:

Post by Xirss »

I use cacti for monitoring lmsensors on some servers - and on one I have trouble - in graphs I have all zero values on graph.
On command /usr/bin/php -q /var/www/cacti/scripts/netsnmp_lmsensors.php voltage 10.0.0.1, dKD:83ls, 3, User, Password, MD5, , [None], , 161, 500 query sensorReading I get this result:

Code: Select all

1:1.216
2:3.328
3:0
4:4.972
5:11.904
6:0
7:0
8:4.919
9:3.232
16:1.55
x00xTheEv1l
Posts: 1
Joined: Thu Aug 14, 2008 7:17 am
Contact:

Post by x00xTheEv1l »

chewbacca156 wrote:Here is the solution to get multiple sources graph working (such as 8x -or less- thermals, voltages and fans) :
- In graph templates, select the template (8x thermals for exemple)
- In each Graph Item Input (Thermal Sensor 1, 2, etc...), tick the line AND gprints associated
- save and now smile watching your graphs ;)
Hello, please can you describe, where should be the line AND gprints associated ? Im watching to my Graph Item Input and there is no such line ...

Thanks in the advance ...
lbegault
Posts: 2
Joined: Thu Sep 11, 2008 12:31 pm

Core-temp improvement

Post by lbegault »

I made some modification to the script in order to support lmsensors core temp values (for multi core cpu). Here is the script, the new dataquery and a graph template for a 4x sensor.
Just a note: for graph the 1st value has a 100-value cdef as a workaround of the intel core-sensor bug.
Hope it can help someone.
Attachments
lmsensors-coretemp.tgz
(7.5 KiB) Downloaded 1638 times
laos
Posts: 1
Joined: Mon Nov 10, 2008 2:23 pm
Location: Pelotas/RS Brasil
Contact:

fan graph

Post by laos »

im using cacti 0.8.7b with net-snmp version 5.4.1 and sensors version 3.0.0 in ubuntu server edition 8.04.1 everything works fine after i update the script but in ucd/net - lmSensors - Fan Sensors i got this: This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.

i run and get this:

Code: Select all

+ Running data query [13].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php fan 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php fan 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 query sensorDevice'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php fan 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 query sensorName'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_fan.xml'
sensors returns this:

Code: Select all

k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp:  -49.0°C                                    
Core1 Temp:  +39.0°C                                    

f71882fg-isa-0e80
Adapter: ISA adapter
3.3V:        +3.44 V
Vcore:       +1.27 V  (max =  +2.04 V)   
Vdimm:       +1.89 V
Vchip:       +1.57 V
+5V:         +5.04 V
12V:        +14.37 V
5VSB:        +8.82 V
3VSB:        +3.42 V
Battery:     +3.10 V
CPU:        2276 RPM
System:     3355 RPM
Power:         0 RPM  ALARM
Aux:           0 RPM  ALARM
CPU:         +32.0°C  (high = +85.0°C, hyst = +81.0°C)  
                      (crit = +100.0°C, hyst = +96.0°C)  sensor = transistor
System:      +34.0°C  (high = +85.0°C, hyst = +81.0°C)  
                      (crit = +100.0°C, hyst = +96.0°C)  sensor = thermistor

snmpwalk -v 2c -c public localhost sensors returns

Code: Select all

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: Core0 Temp
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: Core1 Temp
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: temp3
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 4294918296
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 40000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 127000
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::lmVoltSensorsIndex.7 = INTEGER: 6
LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 7
LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: 3.3V
LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: Vcore
LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: Vdimm
LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: Vchip
LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: +5V
LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: 12V
LM-SENSORS-MIB::lmVoltSensorsDevice.7 = STRING: 5VSB
LM-SENSORS-MIB::lmVoltSensorsDevice.8 = STRING: 3VSB
LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 3439
LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 1264
LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 1887
LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 1568
LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 5040
LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 14266
LM-SENSORS-MIB::lmVoltSensorsValue.7 = Gauge32: 8820
LM-SENSORS-MIB::lmVoltSensorsValue.8 = Gauge32: 3423
LM-SENSORS-MIB::lmMiscSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmMiscSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmMiscSensorsIndex.3 = INTEGER: 2
LM-SENSORS-MIB::lmMiscSensorsIndex.4 = INTEGER: 3
LM-SENSORS-MIB::lmMiscSensorsIndex.5 = INTEGER: 4
LM-SENSORS-MIB::lmMiscSensorsIndex.6 = INTEGER: 5
LM-SENSORS-MIB::lmMiscSensorsIndex.7 = INTEGER: 6
LM-SENSORS-MIB::lmMiscSensorsDevice.1 = STRING: Battery
LM-SENSORS-MIB::lmMiscSensorsDevice.2 = STRING: CPU
LM-SENSORS-MIB::lmMiscSensorsDevice.3 = STRING: System
LM-SENSORS-MIB::lmMiscSensorsDevice.4 = STRING: CPU
LM-SENSORS-MIB::lmMiscSensorsDevice.5 = STRING: System
LM-SENSORS-MIB::lmMiscSensorsDevice.6 = STRING: Power
LM-SENSORS-MIB::lmMiscSensorsDevice.7 = STRING: Aux
LM-SENSORS-MIB::lmMiscSensorsValue.1 = Gauge32: 3104
LM-SENSORS-MIB::lmMiscSensorsValue.2 = Gauge32: 33000
LM-SENSORS-MIB::lmMiscSensorsValue.3 = Gauge32: 34000
LM-SENSORS-MIB::lmMiscSensorsValue.4 = Gauge32: 2276000
LM-SENSORS-MIB::lmMiscSensorsValue.5 = Gauge32: 3370000
LM-SENSORS-MIB::lmMiscSensorsValue.6 = Gauge32: 0
LM-SENSORS-MIB::lmMiscSensorsValue.7 = Gauge32: 0

any idea?

thanks
User avatar
Simba7
Posts: 31
Joined: Tue Sep 11, 2007 10:56 am

Post by Simba7 »

Is there a way to make this work with dual CPUs?

Here's the output of sensors:

Code: Select all

as99127f-i2c-0-2d
Adapter: SMBus PIIX4 adapter at 0580
VCore 1:   +1.76 V  (min =  +1.54 V, max =  +1.95 V)
VCore 2:   +1.74 V  (min =  +1.54 V, max =  +1.95 V)
+3.3V:     +3.33 V  (min =  +2.96 V, max =  +3.63 V)
+5V:       +4.97 V  (min =  +4.49 V, max =  +5.51 V)
+12V:     +12.59 V  (min =  +9.55 V, max = +14.41 V)
-12V:      -2.03 V  (min =  -4.07 V, max =  -0.32 V)
-5V:       -1.13 V  (min =  -1.76 V, max =  -0.82 V)
fan1:     5273 RPM  (min = 4927 RPM, div = 2)
fan2:     5192 RPM  (min =   -1 RPM, div = 2)
fan3:        0 RPM  (min = 42187 RPM, div = 2)
M/B Temp:     +9 C  (high =  +107 C, hyst =   -95 C)
CPU Temp:  +67.5 C  (high =   +80 C, hyst =   +75 C)
temp3:     +67.5 C  (high =   +80 C, hyst =   +75 C)
vid:      +1.750 V  (VRM Version 8.2)
alarms:   Chassis intrusion detection                      ALARM
beep_enable:
          Sound alarm enabled
CPU is CPU #1 and temp3 is CPU #2.
psyvenon
Posts: 2
Joined: Tue Jan 06, 2009 5:56 am

Post by psyvenon »

I have a little problem here...

My graphs aren't working and when i run the verbose query, i gete the following message:

+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 1, , , 161, 500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 1, , , 161, 500 query sensorDevice'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 1, , , 161, 500 query sensorName'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'

When i run the script mannualy in console, i get the following error:
"No sensors were found"

So i think that my problem is that SNMP is not working...

How do i solve the problem?
eL_vErDe
Posts: 3
Joined: Mon Sep 03, 2007 8:58 am
Location: Metz, France

Post by eL_vErDe »

Hi,

All my graphes are stuck to zero.
Here is the verbose query log:
+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 query sensorDevice'
+ Found item [sensorDevice='14'] index: 14
+ Found item [sensorDevice='15'] index: 15
+ Found item [sensorDevice='16'] index: 16
+ Found item [sensorDevice='18'] index: 18
+ Found item [sensorDevice='19'] index: 19
+ Found item [sensorDevice='20'] index: 20
+ Found item [sensorDevice='21'] index: 21
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, public, 2, , , MD5, , DES, , 161, 500 query sensorName'
+ Found item [sensorName='Sys Temp'] index: 14
+ Found item [sensorName='CPU Temp'] index: 15
+ Found item [sensorName='AUX Temp'] index: 16
+ Found item [sensorName='Core 0'] index: 18
+ Found item [sensorName='Core 1'] index: 19
+ Found item [sensorName='Core 2'] index: 20
+ Found item [sensorName='Core 3'] index: 21
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/lmsensors_temp.xml'

So I created graphes for each Core * sensors but the graph always show 0.

What can I do to figure out what's wrong ?

Thanks in advance.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

I uploaded a new version that should work with 0.8.6 and 0.8.7 including the SNMPv3 stuff in 0.8.7

Note that some of the file names changed, so it's best to do a complete installation according to the instructions in the first post
andyburns
Posts: 5
Joined: Wed Apr 15, 2009 8:50 am

FAILED -- no matching sensors were found

Post by andyburns »

ehall wrote:I uploaded a new version that should work with 0.8.6 and 0.8.7 including the SNMPv3 stuff in 0.8.7
Just installed your latest sensors stuff

The machine with sensors to be monitored has installed
fedora 10
net-snmp 5.4.2.1
lm_sensors 3.0.2

I can run
# sensors

and get sensible results locally

w83627dhg-isa-0290
Adapter: ISA adapter
VCore: +1.12 V (min = +0.00 V, max = +1.74 V)
in1: +11.46 V (min = +7.02 V, max = +11.88 V)
AVCC: +3.30 V (min = +0.45 V, max = +2.24 V) ALARM
3VCC: +3.30 V (min = +0.37 V, max = +0.67 V) ALARM
in4: +1.14 V (min = +0.12 V, max = +0.64 V) ALARM
in5: +1.68 V (min = +0.02 V, max = +0.01 V) ALARM
in6: +3.79 V (min = +0.67 V, max = +6.35 V)
VSB: +3.30 V (min = +3.23 V, max = +1.10 V) ALARM
VBAT: +3.30 V (min = +0.53 V, max = +0.62 V) ALARM
Case Fan: 0 RPM (min = 10546 RPM, div = 128) ALARM
CPU Fan: 1562 RPM (min = 10546 RPM, div = 4) ALARM
Aux Fan: 2445 RPM (min = 3443 RPM, div = 4) ALARM
fan5: 0 RPM (min = 10546 RPM, div = 128) ALARM
Sys Temp: +46.0°C (high = +13.0°C, hyst = +85.0°C) sensor = thermistor
CPU Temp: +49.0°C (high = +80.0°C, hyst = +75.0°C) sensor = diode
AUX Temp: +127.0°C (high = +80.0°C, hyst = +75.0°C) ALARM sensor = thermistor
cpu0_vid: +1.550 V

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +48.0°C (high = +78.0°C, crit = +100.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +48.0°C (high = +78.0°C, crit = +100.0°C)

The cacti machine has installed
centos 5.3
cacti 0.8.7d
php 5.1.6
net-snmp 5.3.2.2

I can run
# snmpwalk -v 2c -c public 192.168.1.232 sensors

and get sensible results remotely

LM-SENSORS-MIB::lmTempSensorsIndex.14 = INTEGER: 14
LM-SENSORS-MIB::lmTempSensorsIndex.15 = INTEGER: 15
LM-SENSORS-MIB::lmTempSensorsIndex.16 = INTEGER: 16
LM-SENSORS-MIB::lmTempSensorsIndex.18 = INTEGER: 18
LM-SENSORS-MIB::lmTempSensorsIndex.19 = INTEGER: 19
LM-SENSORS-MIB::lmTempSensorsDevice.14 = STRING: Sys Temp
LM-SENSORS-MIB::lmTempSensorsDevice.15 = STRING: CPU Temp
LM-SENSORS-MIB::lmTempSensorsDevice.16 = STRING: AUX Temp
LM-SENSORS-MIB::lmTempSensorsDevice.18 = STRING: Core 0
LM-SENSORS-MIB::lmTempSensorsDevice.19 = STRING: Core 1
LM-SENSORS-MIB::lmTempSensorsValue.14 = Gauge32: 46000
LM-SENSORS-MIB::lmTempSensorsValue.15 = Gauge32: 49000
LM-SENSORS-MIB::lmTempSensorsValue.16 = Gauge32: 127000
LM-SENSORS-MIB::lmTempSensorsValue.18 = Gauge32: 48000
LM-SENSORS-MIB::lmTempSensorsValue.19 = Gauge32: 48000
LM-SENSORS-MIB::lmFanSensorsIndex.10 = INTEGER: 10
LM-SENSORS-MIB::lmFanSensorsIndex.11 = INTEGER: 11
LM-SENSORS-MIB::lmFanSensorsIndex.12 = INTEGER: 12
LM-SENSORS-MIB::lmFanSensorsIndex.13 = INTEGER: 13
LM-SENSORS-MIB::lmFanSensorsDevice.10 = STRING: Case Fan
LM-SENSORS-MIB::lmFanSensorsDevice.11 = STRING: CPU Fan
LM-SENSORS-MIB::lmFanSensorsDevice.12 = STRING: Aux Fan
LM-SENSORS-MIB::lmFanSensorsDevice.13 = STRING: fan5
LM-SENSORS-MIB::lmFanSensorsValue.10 = Gauge32: 0
LM-SENSORS-MIB::lmFanSensorsValue.11 = Gauge32: 1679
LM-SENSORS-MIB::lmFanSensorsValue.12 = Gauge32: 2445
LM-SENSORS-MIB::lmFanSensorsValue.13 = Gauge32: 0
LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 1
LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 2
LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 3
LM-SENSORS-MIB::lmVoltSensorsIndex.4 = INTEGER: 4
LM-SENSORS-MIB::lmVoltSensorsIndex.5 = INTEGER: 5
LM-SENSORS-MIB::lmVoltSensorsIndex.6 = INTEGER: 6
LM-SENSORS-MIB::lmVoltSensorsIndex.7 = INTEGER: 7
LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 8
LM-SENSORS-MIB::lmVoltSensorsIndex.9 = INTEGER: 9
LM-SENSORS-MIB::lmVoltSensorsIndex.17 = INTEGER: 17
LM-SENSORS-MIB::lmVoltSensorsDevice.1 = STRING: VCore
LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: in1
LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: AVCC
LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: 3VCC
LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: in4
LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: in5
LM-SENSORS-MIB::lmVoltSensorsDevice.7 = STRING: in6
LM-SENSORS-MIB::lmVoltSensorsDevice.8 = STRING: VSB
LM-SENSORS-MIB::lmVoltSensorsDevice.9 = STRING: VBAT
LM-SENSORS-MIB::lmVoltSensorsDevice.17 = STRING: cpu0_vid
LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 1120
LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 11457
LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 3296
LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 3296
LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 1144
LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 1680
LM-SENSORS-MIB::lmVoltSensorsValue.7 = Gauge32: 3788
LM-SENSORS-MIB::lmVoltSensorsValue.8 = Gauge32: 3296
LM-SENSORS-MIB::lmVoltSensorsValue.9 = Gauge32: 3296
LM-SENSORS-MIB::lmVoltSensorsValue.17 = Gauge32: 1550

Within cacti the imported data queries look fine, and can see their corresponding XML files, I added the three sensors queries to the device, and created data sources and graphs OK, but the poller is complaining for each sensor value e.g.

04/15/2009 02:55:03 PM - CMDPHP: Poller[0] Host[6] DS[54] CMD: /usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php voltage 192.168.1.232, public, 2, admin, *****, MD5, , DES, , 161, 500 get sensorReading 1, output: FAILED -- no matching sensors were found

04/15/2009 02:55:03 PM - CMDPHP: Poller[0] Host[6] DS[53] CMD: /usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php temperature 192.168.1.232, public, 2, admin, *****, MD5, , DES, , 161, 500 get sensorReading 19, output: FAILED -- no matching sensors were found

Running the php script manually gets the same result, how can I trace more of what's going on inside the script?
andyburns
Posts: 5
Joined: Wed Apr 15, 2009 8:50 am

Re: FAILED -- no matching sensors were found

Post by andyburns »

andyburns wrote: 04/15/2009 02:55:03 PM - CMDPHP: Poller[0] Host[6] DS[54] CMD: /usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php voltage 192.168.1.232, public, 2, admin, *****, MD5, , DES, , 161, 500 get sensorReading 1, output: FAILED -- no matching sensors were found
Seems the problem is related to the index of the counters, the code is expecting the returned index value to be the requested index minus one, when the actual index being returned is the same as the requested index

Code: Select all

        $snmp_arguments[2] = ($oid[0][1] . "." . $cacti_request_index);
        $scratch = call_user_func_array("cacti_snmp_get", $snmp_arguments);

        if ($scratch == ($cacti_request_index - 1)) {

                $cmdoutput[0][0] = $cacti_request_index;
        }

        else {
                echo ("FAILED -- no matching sensors were found\n");

                exit(1);
I've changed the
if ($scratch == ($cacti_request_index - 1)) {

to be
if ($scratch == ($cacti_request_index)) {

and the script now retrieves values, but I just need to double check that I've not introduced an off-by-one bug

Edit: I've just checked the graph values and labels of each index displayed in cacti against the sensor names and values returned by lm_sensors, they all seem to tie up properly, so I think my fix is correct.
Last edited by andyburns on Wed Apr 15, 2009 2:49 pm, edited 1 time in total.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Re: FAILED -- no matching sensors were found

Post by ehall »

That's weird

NetSNMP maintains four different tables of sensor types. Each row of each table represents a different sensor of that type. The rows within each table are keyed by OID starting at 1, while internal index numbers start at 0. The code in question simply issues a request for the OID and then compares the internal value to the requested OID, in order to see if the sensor actually exists in the expected pool (this is a sanity test on the sensor type before the value data is manipulated and processed).

Here is the voltage sensor pool on my test system. As you can see there are eight rows with OID values from 1-8 while the internal index values are numbered from 0-7.

Code: Select all

$snmpwalk -v 2c -c community host .1.3.6.1.4.1.2021.13.16.4.1.1
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::lmVoltSensorsIndex.7 = INTEGER: 6
LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 7
Can you post the output from your host
andyburns
Posts: 5
Joined: Wed Apr 15, 2009 8:50 am

Re: FAILED -- no matching sensors were found

Post by andyburns »

ehall wrote:NetSNMP maintains four different tables of sensor types. Each row of each table represents a different sensor of that type. The rows within each table are keyed by OID starting at 1, while internal index numbers start at 0.

Can you post the output from your host
Sure, mine seem to base at 1 rather than 0, I get the same result whether I do the snmpwalk locally on the machine with the sensors, or across the network from my cacti machine. Same also true for Fan and Thermal tables

Code: Select all

# snmpwalk -v 2c -c public 192.168.1.232 .1.3.6.1.4.1.2021.13.16.4.1.1
LM-SENSORS-MIB::lmVoltSensorsIndex.1 = INTEGER: 1
LM-SENSORS-MIB::lmVoltSensorsIndex.2 = INTEGER: 2
LM-SENSORS-MIB::lmVoltSensorsIndex.3 = INTEGER: 3
LM-SENSORS-MIB::lmVoltSensorsIndex.4 = INTEGER: 4
LM-SENSORS-MIB::lmVoltSensorsIndex.5 = INTEGER: 5
LM-SENSORS-MIB::lmVoltSensorsIndex.6 = INTEGER: 6
LM-SENSORS-MIB::lmVoltSensorsIndex.7 = INTEGER: 7
LM-SENSORS-MIB::lmVoltSensorsIndex.8 = INTEGER: 8
LM-SENSORS-MIB::lmVoltSensorsIndex.9 = INTEGER: 9
LM-SENSORS-MIB::lmVoltSensorsIndex.17 = INTEGER: 17
john_d13
Posts: 41
Joined: Mon Mar 17, 2008 11:51 pm

Post by john_d13 »

Im runing on an ubuntu box with latest version of lm sensors.

I get this output

giancarlo@Home-Server-Ubx64:/var/www/scripts$ snmpwalk -v 2c -c public 127.0.0.1 sensors
LM-SENSORS-MIB::lmSensors = No more variables left in this MIB View (It is past the end of the MIB tree)

hoever I do get a response when running sensors:

giancarlo@Home-Server-Ubx64:/var/www/scripts$ sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: +41.0°C

w83627thf-isa-0290
Adapter: ISA adapter
VCore: +1.50 V (min = +0.70 V, max = +1.87 V)
+12V: +11.98 V (min = +5.47 V, max = +0.67 V) ALARM
+3.3V: +3.41 V (min = +0.58 V, max = +1.15 V) ALARM
+5V: +5.04 V (min = +3.47 V, max = +6.72 V)
-12V: -11.62 V (min = -6.69 V, max = -14.25 V) ALARM
V5SB: +5.11 V (min = +2.07 V, max = +3.84 V) ALARM
VBat: +2.80 V (min = +0.67 V, max = +0.02 V) ALARM
fan1: 0 RPM (min = 1288 RPM, div = 8) ALARM
CPU Fan: 4963 RPM (min = 84375 RPM, div = 8) ALARM
fan3: 0 RPM (min = 8035 RPM, div = 2) ALARM
M/B Temp: +42.0°C (high = +18.0°C, hyst = +4.0°C) ALARM sensor = thermistor
CPU Temp: -72.5°C (high = +80.0°C, hyst = +75.0°C) sensor = diode
temp3: -48.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor
cpu0_vid: +0.000 V
beep_enable:enabled


anyone ?
skysurfer
Posts: 15
Joined: Tue Aug 07, 2007 7:26 am

Post by skysurfer »

I have installed the latest version of the template following the instructions on the first post.

Single graphs are working like a charm :)

The problem is at the 8x templates:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="ovelix.skysurfer.twmn - Voltage Sensors" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=-15 \
--vertical-label="Volts" \
--slope-mode \
--font TITLE:9:/usr/share/fonts/TTF/times.ttf \
--font AXIS:7:/usr/share/fonts/TTF/times.ttf \
--font LEGEND:7:/usr/share/fonts/TTF/times.ttf \
--font UNIT:7:/usr/share/fonts/TTF/times.ttf \
DEF:a="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_272.rrd":sensorReading:LAST \
DEF:b="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_273.rrd":sensorReading:LAST \
DEF:c="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_270.rrd":sensorReading:LAST \
DEF:d="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_266.rrd":sensorReading:LAST \
DEF:e="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_268.rrd":sensorReading:LAST \
DEF:f="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_269.rrd":sensorReading:LAST \
DEF:g="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_271.rrd":sensorReading:LAST \
DEF:h="/srv/http/cacti/rra/ovelix_skysurfer_twmn_sensorreading_267.rrd":sensorReading:LAST \
LINE1:a#00FF00FF:"+1.5V"  \
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"  \
LINE1:b#0000FFFF:"+1.8V"  \
GPRINT:b:LAST:"Current\:%8.2lf%s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:b:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:c#EA8F00FF:"+12V"  \
GPRINT:c:LAST:" Current\:%8.2lf%s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:c:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:c:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:d#A150AAFF:"+2.5V"  \
GPRINT:d:LAST:"Current\:%8.2lf%s"  \
GPRINT:d:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:d:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:d:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:e#74C366FF:"+3.3V"  \
GPRINT:e:LAST:"Current\:%8.2lf%s"  \
GPRINT:e:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:e:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:e:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:f#9FA4EEFF:"+5V"  \
GPRINT:f:LAST:"  Current\:%8.2lf%s"  \
GPRINT:f:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:f:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:f:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:g#CCBB00FF:"VCC"  \
GPRINT:g:LAST:"  Current\:%8.2lf%s"  \
GPRINT:g:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:g:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:g:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:h#DA4725FF:"VCore"  \
GPRINT:h:LAST:"Current\:%8.2lf%s"  \
GPRINT:h:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:h:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:h:MAX:"Maximum\:%8.2lf%s\n" 

RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF
Any solution?

cacti 0.8.7d
net-snmp 5.4.2.1
mo02
Posts: 1
Joined: Thu Apr 16, 2009 2:29 pm

Post by mo02 »

andyburns - your fix worked for my environment, thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests