Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


ucd/net-SNMP lmSensors -- update Feb 10, 2007
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
sithgunner



Joined: 08 Feb 2007
Posts: 5

PostPosted: Thu Feb 08, 2007 11:53 pm    Post subject: Reply with quote

I kept getting errors about making the graph to merge, so I messed around a bit and finally got it working. And here's my templates, for someone might save time I used to click several hundred times and increase about 100 page views on cacti web

Somehow I didn't have 8 data sources for voltage, namely -5V, and ended up having 3 fan readings, 3 thermal readings and 7 voltage readings.

These are the templates I used to work on *mine*.

As for the fans, I lost the 2 sensor readings (since I didn't have them turned on and deleted the entries) and never could pull it back, so I set 3 readings all on CPU fan... so, you have to fix that to suit yourself to read the other fan readings if you have them.



cacti-lmsensors-template-updated.zip
 Description:
3 sensors updated template, use import function in cacti.

Download
 Filename:  cacti-lmsensors-template-updated.zip
 Filesize:  9.65 KB
 Downloaded:  1198 Time(s)

Back to top
ehall
Cacti User


Joined: 09 Dec 2005
Posts: 160

PostPosted: Sat Feb 10, 2007 11:35 am    Post subject: Reply with quote

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.
Back to top
Merrick



Joined: 23 Mar 2007
Posts: 2

PostPosted: Fri Mar 23, 2007 7:16 am    Post subject: Reply with quote

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:

+ 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:

+ 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 ?
Back to top
Merrick



Joined: 23 Mar 2007
Posts: 2

PostPosted: Fri Mar 23, 2007 9:00 am    Post subject: Reply with quote

OK, forget that, I forgot to set the community name in the device configuration...
Back to top
cactiuser2



Joined: 10 Jul 2007
Posts: 3

PostPosted: Tue Jul 10, 2007 7:11 pm    Post subject: RRDtool error Reply with quote

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:

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.
Back to top
filipe.montenegro



Joined: 05 Jul 2007
Posts: 7

PostPosted: Tue Jul 17, 2007 8:20 am    Post subject: Reply with quote

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:


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?



ScreenShot001.jpg
 Description:
 Filesize:  41.99 KB
 Viewed:  6854 Time(s)

ScreenShot001.jpg


Back to top
filipe.montenegro



Joined: 05 Jul 2007
Posts: 7

PostPosted: Mon Jul 23, 2007 7:03 am    Post subject: Reply with quote

help me!
Back to top
Alives
Cacti User


Joined: 11 Jul 2005
Posts: 103

PostPosted: Mon Aug 06, 2007 3:28 pm    Post subject: Reply with quote

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.
Back to top
nicowork



Joined: 03 Dec 2007
Posts: 1

PostPosted: Mon Dec 03, 2007 12:18 pm    Post subject: Reply with quote

Back to top
orion



Joined: 04 Jan 2008
Posts: 7

PostPosted: Fri Jan 04, 2008 11:25 am    Post subject: Reply with quote

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:
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:

+ 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
Back to top
orion



Joined: 04 Jan 2008
Posts: 7

PostPosted: Fri Jan 04, 2008 11:33 pm    Post subject: Reply with quote

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
Back to top
skysurfer



Joined: 07 Aug 2007
Posts: 9

PostPosted: Tue Jan 15, 2008 9:10 pm    Post subject: Reply with quote

lm_sensors not working since upgrade to cacti 0.8.7a

need help plz
Back to top
orion



Joined: 04 Jan 2008
Posts: 7

PostPosted: Wed Jan 16, 2008 3:00 am    Post subject: Reply with quote

Where exactly is the problem as I have it working with 8.7a
Back to top
skysurfer



Joined: 07 Aug 2007
Posts: 9

PostPosted: Wed Jan 16, 2008 10:10 am    Post subject: Reply with quote

No sensors at all are found


lm_sensors.png
 Description:
 Filesize:  38.78 KB
 Viewed:  4841 Time(s)

lm_sensors.png


Back to top
orion



Joined: 04 Jan 2008
Posts: 7

PostPosted: Wed Jan 16, 2008 8:02 pm    Post subject: Reply with quote

what do you get when you run snmpwalk -v 2c -c public <IP Address> sensors
do you get anything
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 4 of 7

 



Powered by phpBB © 2001, 2005 phpBB Group