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 »

The posted update contains a fix that converts the SNMP timeout value from Cacti's millisecond format to PHP/Net-SNMP microsecond format. The lack of conversion in the earlier script would sometimes result in excessive retries or complete failure.
Merrick
Posts: 2
Joined: Fri Mar 23, 2007 7:14 am
Contact:

Post by Merrick »

Sorry, i'm a beginner, and I don't "write" english well, but I'll try to explain my problem.

I've installed the plugin as said on this forum, but I can't make it work. When I try a verbose query, I obtain :

Code: Select all

+ Running data query [16].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php fan 127.0.0.1, , 1, , , 161, 500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php fan 127.0.0.1, , 1, , , 161, 500 query sensorDevice'
+ Found item [sensorDevice=' /usr/share/cacti/scripts/netsnmp_lmsensors.php (FAN|TEMPERATURE|VOLTAGE)'] index: syntax
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php fan 127.0.0.1, , 1, , , 161, 500 query sensorName'
+ Found item [sensorName=' /usr/share/cacti/scripts/netsnmp_lmsensors.php (FAN|TEMPERATURE|VOLTAGE)'] index: syntax
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_fan.xml'

Code: Select all

+ Running data query [17].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_temp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, , 1, , , 161, 500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, , 1, , , 161, 500 query sensorDevice'
+ Found item [sensorDevice=' /usr/share/cacti/scripts/netsnmp_lmsensors.php (FAN|TEMPERATURE|VOLTAGE)'] index: syntax
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php temperature 127.0.0.1, , 1, , , 161, 500 query sensorName'
+ Found item [sensorName=' /usr/share/cacti/scripts/netsnmp_lmsensors.php (FAN|TEMPERATURE|VOLTAGE)'] index: syntax
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_temp.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/lmsensors_temp.xml'
What should I do to make it work ?
Merrick
Posts: 2
Joined: Fri Mar 23, 2007 7:14 am
Contact:

Post by Merrick »

OK, forget that, I forgot to set the community name in the device configuration...
cactiuser2
Posts: 3
Joined: Tue Jul 10, 2007 7:07 pm

RRDtool error

Post by cactiuser2 »

I got everything working with individual graphs, so I duplicated the 8x graph, deleted the last items, and then built a new graph with this new template. However, I get this error:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Voltage Sensors" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=-15 \
--vertical-label="Volts" \
--slope-mode \
DEF:a="/usr/share/cacti/site/rra/localhost_sensorreading_29.rrd":sensorReading:LAST \
DEF:b="/usr/share/cacti/site/rra/localhost_sensorreading_30.rrd":sensorReading:LAST \
DEF:c="/usr/share/cacti/site/rra/localhost_sensorreading_33.rrd":sensorReading:LAST \
DEF:d="/usr/share/cacti/site/rra/localhost_sensorreading_34.rrd":sensorReading:LAST \
DEF:e="/usr/share/cacti/site/rra/localhost_sensorreading_32.rrd":sensorReading:LAST \
DEF:f="/usr/share/cacti/site/rra/localhost_sensorreading_35.rrd":sensorReading:LAST \
DEF:g="/usr/share/cacti/site/rra/localhost_sensorreading_31.rrd":sensorReading:LAST \
LINE1:a#00FF00:"VCore 1"  \
GPRINT::LAST:"Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"Average\:%8.2lf%s"  \
GPRINT::MIN:"Minimum\:%8.2lf%s"  \
GPRINT::MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:b#0000FF:"VCore 2"  \
GPRINT::LAST:"Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"Average\:%8.2lf%s"  \
GPRINT::MIN:"Minimum\:%8.2lf%s"  \
GPRINT::MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:c#EA8F00:"+12V"  \
GPRINT::LAST:"   Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"   Average\:%8.2lf%s"  \
GPRINT::MIN:"   Minimum\:%8.2lf%s"  \
GPRINT::MAX:"   Maximum\:%8.2lf%s\n"  \
LINE1:d#A150AA:"-12V"  \
GPRINT::LAST:"   Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"   Average\:%8.2lf%s"  \
GPRINT::MIN:"   Minimum\:%8.2lf%s"  \
GPRINT::MAX:"   Maximum\:%8.2lf%s\n"  \
LINE1:e#74C366:"+5V"  \
GPRINT::LAST:"    Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"    Average\:%8.2lf%s"  \
GPRINT::MIN:"    Minimum\:%8.2lf%s"  \
GPRINT::MAX:"    Maximum\:%8.2lf%s\n"  \
LINE1:f#9FA4EE:"-5V"  \
GPRINT::LAST:"    Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"    Average\:%8.2lf%s"  \
GPRINT::MIN:"    Minimum\:%8.2lf%s"  \
GPRINT::MAX:"    Maximum\:%8.2lf%s\n"  \
LINE1:g#CCBB00:"+3.3V"  \
GPRINT::LAST:"  Current\:%8.2lf%s"  \
GPRINT::AVERAGE:"  Average\:%8.2lf%s"  \
GPRINT::MIN:"  Minimum\:%8.2lf%s"  \
GPRINT::MAX:"  Maximum\:%8.2lf%s\n" 

RRDTool Says:

ERROR: Could not parse line 'GPRINT::LAST:Current\:%8.2lf%s'
Any suggestions on how to fix this? I'm running v0.8.6i on Debian Etch.
filipe.montenegro
Posts: 7
Joined: Thu Jul 05, 2007 9:47 am

Post by filipe.montenegro »

Im new on cacti, and i dont now how to install new templates, so i import the file: "cacti_graph_template_sensors_ucdnet_lmsensors_thermal_sensors_8x.xml" and copy the scripts and the script_querry in the cacti folder..

i also add a new data query like this one:
Image

when i debug the graph i see this:

RRDTool Command:

c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Emaster - Civic - Thermal Sensors" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Celsius" \
--slope-mode \
LINE1:#00FF00:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#0000FF:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#EA8F00:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#A150AA:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#74C366:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#9FA4EE:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#CCBB00:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n" \
LINE1:#DA4725:"|query_sensorName|" \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MIN:"Minimum\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n"

RRDTool Says:

ERROR: parameter '#00FF00' does not represent a number in line LINE1:#00FF00:|query_sensorName|


im running cacti in my windows 2003 server... what i need to see the graph?
Attachments
ScreenShot001.jpg
ScreenShot001.jpg (41.99 KiB) Viewed 19340 times
filipe.montenegro
Posts: 7
Joined: Thu Jul 05, 2007 9:47 am

Post by filipe.montenegro »

help me! :lol:
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

I got tired of trying to roll my own net-snmp with lm_sensors included, so I just wrote a script that polls sensors -s and scrapes for the data. It also monitors hard drive temps using smartmontools. I will post as soon as I make sure all the bugs are ironed out.
nicowork
Posts: 3
Joined: Mon Dec 03, 2007 12:13 pm

Post by nicowork »

orion
Posts: 7
Joined: Fri Jan 04, 2008 11:15 am

Post by orion »

I'm having a problem the the data query for lm_sensors at first I thought it was to do with snmp and lm_sensors not playing nicely but now I think they are. as when I run snmpwalk -v 2c -c public 10.1.1.248 sensors I get

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: temp1
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: temp2
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: temp3
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 45000
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 39000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 4294965296
LM-SENSORS-MIB::lmFanSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmFanSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmFanSensorsIndex.3 = INTEGER: 2
LM-SENSORS-MIB::lmFanSensorsDevice.1 = STRING: fan1
LM-SENSORS-MIB::lmFanSensorsDevice.2 = STRING: fan2
LM-SENSORS-MIB::lmFanSensorsDevice.3 = STRING: fan3
LM-SENSORS-MIB::lmFanSensorsValue.1 = Gauge32: 1776
LM-SENSORS-MIB::lmFanSensorsValue.2 = Gauge32: 3708
LM-SENSORS-MIB::lmFanSensorsValue.3 = Gauge32: 0
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::lmMiscSensorsIndex.8 = INTEGER: 7
LM-SENSORS-MIB::lmMiscSensorsIndex.9 = INTEGER: 8
LM-SENSORS-MIB::lmMiscSensorsIndex.10 = INTEGER: 9
LM-SENSORS-MIB::lmMiscSensorsIndex.11 = INTEGER: 10
LM-SENSORS-MIB::lmMiscSensorsIndex.12 = INTEGER: 11
LM-SENSORS-MIB::lmMiscSensorsIndex.13 = INTEGER: 12
LM-SENSORS-MIB::lmMiscSensorsDevice.1 = STRING: in0
LM-SENSORS-MIB::lmMiscSensorsDevice.2 = STRING: in1
LM-SENSORS-MIB::lmMiscSensorsDevice.3 = STRING: in2
LM-SENSORS-MIB::lmMiscSensorsDevice.4 = STRING: in3
LM-SENSORS-MIB::lmMiscSensorsDevice.5 = STRING: in4
LM-SENSORS-MIB::lmMiscSensorsDevice.6 = STRING: in5
LM-SENSORS-MIB::lmMiscSensorsDevice.7 = STRING: in6
LM-SENSORS-MIB::lmMiscSensorsDevice.8 = STRING: in7
LM-SENSORS-MIB::lmMiscSensorsDevice.9 = STRING: in8
LM-SENSORS-MIB::lmMiscSensorsDevice.10 = STRING: vid
LM-SENSORS-MIB::lmMiscSensorsDevice.11 = STRING: alarms
LM-SENSORS-MIB::lmMiscSensorsDevice.12 = STRING: Core 0
LM-SENSORS-MIB::lmMiscSensorsDevice.13 = STRING: Core 1
LM-SENSORS-MIB::lmMiscSensorsValue.1 = Gauge32: 1280
LM-SENSORS-MIB::lmMiscSensorsValue.2 = Gauge32: 1792
LM-SENSORS-MIB::lmMiscSensorsValue.3 = Gauge32: 3359
LM-SENSORS-MIB::lmMiscSensorsValue.4 = Gauge32: 2991
LM-SENSORS-MIB::lmMiscSensorsValue.5 = Gauge32: 640
LM-SENSORS-MIB::lmMiscSensorsValue.6 = Gauge32: 0
LM-SENSORS-MIB::lmMiscSensorsValue.7 = Gauge32: 64
LM-SENSORS-MIB::lmMiscSensorsValue.8 = Gauge32: 3056
LM-SENSORS-MIB::lmMiscSensorsValue.9 = Gauge32: 3120
LM-SENSORS-MIB::lmMiscSensorsValue.10 = Gauge32: 0
LM-SENSORS-MIB::lmMiscSensorsValue.11 = Gauge32: 8208000
LM-SENSORS-MIB::lmMiscSensorsValue.12 = Gauge32: 51000
LM-SENSORS-MIB::lmMiscSensorsValue.13 = Gauge32: 52000
But on my device when I run a ucd/net - lmSensors - Fan Sensors (Verbose Query) I get this
Data Query Debug Information

Code: Select all

+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_fan.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php fan 10.1.1.248, public, 3, orion, <edit>, 161, 500 index'
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php fan 10.1.1.248, public, 3, orion, <edit>, 161, 500 query sensorDevice'
+ Found item [sensorDevice=' Missing argument 9 for cacti_snmp_walk(), called in /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php on line 259 and defined in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 225'] index: Warning
+ Found item [sensorDevice=' Missing argument 10 for cacti_snmp_walk(), called in /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php on line 259 and defined in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 225'] index: Warning
+ Found item [sensorDevice=' Call to undefined function read_config_option() in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 233'] index: Fatal error
+ Executing script query '/usr/bin/php -q /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php fan 10.1.1.248, public, 3, orion, <edit>, 161, 500 query sensorName'
+ Found item [sensorName=' Missing argument 9 for cacti_snmp_walk(), called in /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php on line 259 and defined in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 225'] index: Warning
+ Found item [sensorName=' Missing argument 10 for cacti_snmp_walk(), called in /var/www/localhost/htdocs/cacti/scripts/netsnmp_lmsensors.php on line 259 and defined in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 225'] index: Warning
+ Found item [sensorName=' Call to undefined function read_config_option() in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 233'] index: Fatal error
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_fan.xml'
+ Found data query XML file at '/var/www/localhost/htdocs/cacti/resource/script_queries/lmsensors_fan.xml'
Am I missing something here as I've managed to get other graphs working under cacti (hddtemp,apcupsd,and other snmp ones) just not ones to do with lm_sensors.
Also I'm using the latest Cacti-0.8.7a on a gentoo box connecting to a couple of other gentoo boxes and an ubuntu gutsy box.
Cheers for any help in advance
orion
Posts: 7
Joined: Fri Jan 04, 2008 11:15 am

Post by orion »

Never mind I found the update to the snmp sensors script. Still having a few issues though but I should be able to sort them out now
skysurfer
Posts: 15
Joined: Tue Aug 07, 2007 7:26 am

Post by skysurfer »

lm_sensors not working since upgrade to cacti 0.8.7a

need help plz :)
orion
Posts: 7
Joined: Fri Jan 04, 2008 11:15 am

Post by orion »

Where exactly is the problem as I have it working with 8.7a
skysurfer
Posts: 15
Joined: Tue Aug 07, 2007 7:26 am

Post by skysurfer »

No sensors at all are found
Attachments
lm_sensors.png
lm_sensors.png (38.78 KiB) Viewed 17327 times
orion
Posts: 7
Joined: Fri Jan 04, 2008 11:15 am

Post by orion »

what do you get when you run snmpwalk -v 2c -c public <IP Address> sensors
do you get anything
skysurfer
Posts: 15
Joined: Tue Aug 07, 2007 7:26 am

Post by skysurfer »

orion wrote:what do you get when you run snmpwalk -v 2c -c public <IP Address> sensors
do you get anything
root ~ # snmpwalk -v 2c -c public 127.0.0.1 sensors
sensors: Unknown Object Identifier (Sub-id not found: (top) -> sensors)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest