Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Wed Aug 20, 2014 9:21 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Net-SNMP lm_sensors temperature, fan speed, voltage monitor
PostPosted: Fri Jul 01, 2005 11:18 am 
Offline

Joined: Fri Jul 01, 2005 10:36 am
Posts: 9
I have made template for monitor Temperature, Fan Speed and Voltages with SNMP on lm_sensors enabled Net-SNMP host.

- You may need to customize graph templates and other things suit to your system (and also colors you need).

- You may need to edit sensors.conf of lm_sensors and restart snmpd for change your sensor name from temp1, temp2, fan1, fan2 to CPU Temp, Chassis Fan, etc. (Try see output of 'sensors' command for get chip name and edit /etc/sensors.conf.

Add something like

Code:
label temp1 "CPU Temp"
label temp2 "Board Temp"

label fan1 "CPU Fan"


After

Code:
chip "CHIPNAME-*"


of your sensors chip.

It works for me(TM) for my cacti-0.8.6e on Gentoo

Cheers !

---

You can download templates here and import to your cacti
(use only lm_sensors, TCP connection statistics also work well :)

http://sf-alpha.bjgang.org/downloads/cacti/templates/

Download and put xml files under $CACTI/resources/snmp_queries
(use only lm_sensors)

http://sf-alpha.bjgang.org/downloads/cacti/queries/

---

This script just plot individual Temperature, Fan Speed and Temperature graph on each graph. If you want to graph them all in the one page like
http://forums.cacti.net/viewtopic.php?t=11590&highlight=netsnmp

You can create your own Graph Templates suit to your needs or use
script there (which may not usable on some systems, My DELL system have 7 Fans !!! 4 Temperature Sensors !!! Which not in order and you need to add it yourself with that script)


Last edited by sf_alpha on Tue Mar 28, 2006 5:40 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 10:19 pm 
Offline

Joined: Thu Jul 14, 2005 10:14 pm
Posts: 4
Hello. I'm keen to use your templates and scripts, but my Cacti 0.8.6f doesn't seem to like them. I get "Error: XML parse error." on import. Any ideas? Did you export these scripts using Cacti's "Export Template" function, and what version did you export from?

Let me know if you need more information. Thanks.


Top
 Profile  
 
 Post subject: Retreive problem
PostPosted: Sun Jul 17, 2005 8:04 am 
Offline

Joined: Tue Aug 10, 2004 5:44 pm
Posts: 17
Hai sf_alpha,

I did everything you said on the remote server which is running FC2.
But when I do a manual snmpwalk I get this:
Code:
snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.13.16.2.1.1
UCD-SNMP-MIB::ucdExperimental.16.2.1.1 = No more variables left in this MIB View (It is past the end of the MIB tree)


And when I let cacti run the Dataquery I get this debug info:
Code:
Data Query Debug Information

+ Running data query [16].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/cacti/resource/snmp_queries/net-snmp_lm_sensors_temp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.13.16.2.1.1'
+ No SNMP data returned
+ Found data query XML file at '/www/cacti/resource/snmp_queries/net-snmp_lm_sensors_temp.xml'
+ Found data query XML file at '/www/cacti/resource/snmp_queries/net-snmp_lm_sensors_temp.xml'
+ Found data query XML file at '/www/cacti/resource/snmp_queries/net-snmp_lm_sensors_temp.xml'


Can you please help?? Did I forgot to configure something on the remote host?!?!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2005 2:21 am 
Offline
Cacti User

Joined: Mon Sep 30, 2002 3:23 am
Posts: 62
Location: Germany
hi.

i had the same problem... i had to build net-snmp with lm_sensors flag!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 1:17 pm 
Offline

Joined: Fri Jul 01, 2005 10:36 am
Posts: 9
You need net-snmp with lm-sensors compiled in. I test import script on other server and it works. ... I will try to use from this forum again.


If I can, I will post how to compile net-snmp with lm-sensors later... But with gentoo you need only

USE="lm_sensors" emerge net-snmp


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 5:19 am 
Offline

Joined: Tue Aug 10, 2004 5:44 pm
Posts: 17
lucky wrote:
hi.

i had the same problem... i had to build net-snmp with lm_sensors flag!


Ok!
But when I try to configure with the following command:
Code:
./configure --prefix=/custom/snmp513 --with-mib-modules=agent/mibgroup/ucd-snmp/lmSensors --with-ldflags=-lsensors


I get this error:

Code:
checking for C compiler default output file name... configure: error: C compiler cannot create executables

If I configure with --with-mib-modules=ucd-snmp/lmSensors I get the same error.

Anyone a solution?
I just downloaded the latest src-package (tar.gz) of Net-SNMP and extracted all files in the directory net-snmp-5.1.3/

TIA.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 6:25 am 
Offline

Joined: Fri Jul 01, 2005 10:36 am
Posts: 9
RattleSn@ke wrote:
lucky wrote:
hi.

i had the same problem... i had to build net-snmp with lm_sensors flag!


Ok!
But when I try to configure with the following command:
Code:
./configure --prefix=/custom/snmp513 --with-mib-modules=agent/mibgroup/ucd-snmp/lmSensors --with-ldflags=-lsensors


I get this error:

Code:
checking for C compiler default output file name... configure: error: C compiler cannot create executables

If I configure with --with-mib-modules=ucd-snmp/lmSensors I get the same error.

Anyone a solution?
I just downloaded the latest src-package (tar.gz) of Net-SNMP and extracted all files in the directory net-snmp-5.1.3/

TIA.


I looks in gentoo ebuild. It configure only with --with-mib-modules=ucd-snmp/lmSensors

But it use the patch attached ..


Attachments:
File comment: net-snmp patch
net-snmp-lm_sensors.patch [13.37 KiB]
Downloaded 2618 times
Top
 Profile  
 
 Post subject: Voltage Graphs decimal place
PostPosted: Tue Jul 26, 2005 8:09 am 
Offline
Cacti User

Joined: Tue Mar 22, 2005 10:11 am
Posts: 66
Thanks for the templates, I've had no issues in getting them charting. The only issue I have, is that it appears that the charts are not putting the decimal in the correct place for the volt graphs.

net-snmp reports:
LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: +5V
LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: +12V
LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 1799
LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 4929
LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 12365

However, the values being graphed are getting values such as:
+12V: 124.25
+5V: 51.01
+2.5V: 18.22

Where they should be 12.425V, 5.101V and 1.822 volts.


Where can I change this decimal place?

Thanks


Top
 Profile  
 
 Post subject: Fixed it
PostPosted: Tue Jul 26, 2005 9:28 am 
Offline
Cacti User

Joined: Tue Mar 22, 2005 10:11 am
Posts: 66
I fixed my decimal place, using the CDEF function "Divide by 1000" in the Graph Template works for me.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 26, 2005 9:52 am 
Offline

Joined: Tue Aug 10, 2004 5:44 pm
Posts: 17
Hi everyone!

I GOT IT WORKING! :D :D
Finally, after posting a question to the net-snmp-users mailinglist. Within an hour the answer and a link to the patch! Great! :D

Other question now:
I have copied a script that reads the HDD temperatures.
I've put it in snmpd.conf as exec.

So I get this output when running snmpwalk:
Code:
[root@shaft scripts]# snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.54
UCD-SNMP-MIB::ucdavis.54.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.54.2.1 = STRING: "/dev/hda"
UCD-SNMP-MIB::ucdavis.54.3.1 = STRING: "/bin/sh /custom/snmp513/bin/hdd_temperature /dev/hda"
UCD-SNMP-MIB::ucdavis.54.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.54.101.1 = STRING: "33"
UCD-SNMP-MIB::ucdavis.54.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.54.103.1 = ""


So where the 33 is the temperature. But how do I use this data in Cacti so I get a nice graph?? Like the one my local version is creating ...

The local version is running quite nice! (see attachment)


Attachments:
hddtemp.gif
hddtemp.gif [ 8.62 KiB | Viewed 88541 times ]
Top
 Profile  
 
 Post subject: Re: Fixed it
PostPosted: Tue Jul 26, 2005 12:11 pm 
Offline

Joined: Fri Jul 01, 2005 10:36 am
Posts: 9
jrichardson wrote:
I fixed my decimal place, using the CDEF function "Divide by 1000" in the Graph Template works for me.


I need to fix this. May Different Version of net-snmp gives different value.


Top
 Profile  
 
 Post subject: Re: Fixed it
PostPosted: Tue Jul 26, 2005 1:10 pm 
Offline
Cacti User

Joined: Tue Mar 22, 2005 10:11 am
Posts: 66
sf_alpha wrote:
I need to fix this. May Different Version of net-snmp gives different value.


I'm not sure if it's my version of net-snmp, lm_sensors or the particular sensor module that I'm using. net-snmp should just return via SNMP whatever it gets from lm_sensors, I would think.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 26, 2005 4:29 pm 
Offline

Joined: Tue Aug 10, 2004 5:44 pm
Posts: 17
whow, finally got everything working as normal.
What I was wondering (and trying) is how do I graph both cpu and case temperature in one single graph?

How do I select the two datasources in one graph template??

Tnx.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:40 pm 
Offline

Joined: Fri Jul 01, 2005 10:36 am
Posts: 9
RattleSn@ke wrote:
whow, finally got everything working as normal.
What I was wondering (and trying) is how do I graph both cpu and case temperature in one single graph?

How do I select the two datasources in one graph template??

Tnx.


You need custom data templates (using OID) to get information
for each temp sensors (using a few datasources in one data templates). And then new graph template that add serveral temperature graph on it.
You may need to crate data templates for each host because lm_sensors sometimes not return temperature value in same order (But mostly the same).

Try snmpwalk :)

Code:
sf_alpha@dekdoi ~ $ snmpwalk -c public -v 1 localhost lmTempSensors
LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 0
LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 1
LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: M/B Temp
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU Temp
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 51000
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 63000
sf_alpha@dekdoi ~ $ snmpwalk -c public -v 1 localhost -O n lmTempSensors
.1.3.6.1.4.1.2021.13.16.2.1.1.1 = INTEGER: 0
.1.3.6.1.4.1.2021.13.16.2.1.1.2 = INTEGER: 1
.1.3.6.1.4.1.2021.13.16.2.1.2.1 = STRING: M/B Temp
.1.3.6.1.4.1.2021.13.16.2.1.2.2 = STRING: CPU Temp
.1.3.6.1.4.1.2021.13.16.2.1.3.1 = Gauge32: 51000
.1.3.6.1.4.1.2021.13.16.2.1.3.2 = Gauge32: 63000



This is limit of cacti. Indexes SNMP Query must give same output value and lm_ Sensors gives only 1 output at each sensors on it own index, Not every sensors (Every host not have same numbers of sensors).

-----


Code:
sf_alpha@dekdoi ~ $ snmpwalk -c public -v 1 -O n localhost lmVoltSensors
.1.3.6.1.4.1.2021.13.16.4.1.1.1 = INTEGER: 0
.1.3.6.1.4.1.2021.13.16.4.1.1.2 = INTEGER: 1
.1.3.6.1.4.1.2021.13.16.4.1.1.3 = INTEGER: 2
.1.3.6.1.4.1.2021.13.16.4.1.1.4 = INTEGER: 3
.1.3.6.1.4.1.2021.13.16.4.1.1.5 = INTEGER: 4
.1.3.6.1.4.1.2021.13.16.4.1.1.6 = INTEGER: 5
.1.3.6.1.4.1.2021.13.16.4.1.1.7 = INTEGER: 6
.1.3.6.1.4.1.2021.13.16.4.1.1.8 = INTEGER: 7
.1.3.6.1.4.1.2021.13.16.4.1.2.1 = STRING: VCore
.1.3.6.1.4.1.2021.13.16.4.1.2.2 = STRING: +3.3V
.1.3.6.1.4.1.2021.13.16.4.1.2.3 = STRING: +5V
.1.3.6.1.4.1.2021.13.16.4.1.2.4 = STRING: +12V
.1.3.6.1.4.1.2021.13.16.4.1.2.5 = STRING: -12V
.1.3.6.1.4.1.2021.13.16.4.1.2.6 = STRING: -5V
.1.3.6.1.4.1.2021.13.16.4.1.2.7 = STRING: V5SB
.1.3.6.1.4.1.2021.13.16.4.1.2.8 = STRING: VBat
.1.3.6.1.4.1.2021.13.16.4.1.3.1 = Gauge32: 1488
.1.3.6.1.4.1.2021.13.16.4.1.3.2 = Gauge32: 3120
.1.3.6.1.4.1.2021.13.16.4.1.3.3 = Gauge32: 5080
.1.3.6.1.4.1.2021.13.16.4.1.3.4 = Gauge32: 11491
.1.3.6.1.4.1.2021.13.16.4.1.3.5 = Gauge32: 18446744073709539256
.1.3.6.1.4.1.2021.13.16.4.1.3.6 = Gauge32: 18446744073709546117
.1.3.6.1.4.1.2021.13.16.4.1.3.7 = Gauge32: 5456
.1.3.6.1.4.1.2021.13.16.4.1.3.8 = Gauge32: 3536
sf_alpha@dekdoi ~ $ snmpwalk -c public -v 1 localhost lmVoltSensors
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: VCore
LM-SENSORS-MIB::lmVoltSensorsDevice.2 = STRING: +3.3V
LM-SENSORS-MIB::lmVoltSensorsDevice.3 = STRING: +5V
LM-SENSORS-MIB::lmVoltSensorsDevice.4 = STRING: +12V
LM-SENSORS-MIB::lmVoltSensorsDevice.5 = STRING: -12V
LM-SENSORS-MIB::lmVoltSensorsDevice.6 = STRING: -5V
LM-SENSORS-MIB::lmVoltSensorsDevice.7 = STRING: V5SB
LM-SENSORS-MIB::lmVoltSensorsDevice.8 = STRING: VBat
LM-SENSORS-MIB::lmVoltSensorsValue.1 = Gauge32: 1488
LM-SENSORS-MIB::lmVoltSensorsValue.2 = Gauge32: 3120
LM-SENSORS-MIB::lmVoltSensorsValue.3 = Gauge32: 5080
LM-SENSORS-MIB::lmVoltSensorsValue.4 = Gauge32: 11491
LM-SENSORS-MIB::lmVoltSensorsValue.5 = Gauge32: 18446744073709539256
LM-SENSORS-MIB::lmVoltSensorsValue.6 = Gauge32: 18446744073709546117
LM-SENSORS-MIB::lmVoltSensorsValue.7 = Gauge32: 5456
LM-SENSORS-MIB::lmVoltSensorsValue.8 = Gauge32: 3536
sf_alpha@dekdoi ~ $ snmpwalk -c public -v 1 localhost lmVoltSensors


I had problems with negative value. I have try 64bit 2's complement cannot solve this and it return wrong value. I don't know this is rrdtool bugs or cacti :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 12:54 am 
Offline
Cacti User

Joined: Mon Jul 11, 2005 11:39 am
Posts: 103
is it possible for net-snmp to compile with lm sensors in win32?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group