Net-SNMP lm_sensors temperature, fan speed, voltage monitor

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

Moderators: Developers, Moderators

hterag
Posts: 9
Joined: Wed Jun 29, 2005 11:23 pm

Post by hterag »

I am having the same problem with negative numbers.

I cannot get the voltage or temperature readings to work.

I get these errors.

Running data query
Unkown type = ""

any ideas?
hterag
Posts: 9
Joined: Wed Jun 29, 2005 11:23 pm

Post by hterag »

Well I got that error to go away, for some reason the values for data_input_id in the snmp_query table were completely wrong.

I still can't get anything to happen with the temperature or voltage readings.
The indexing queries work ok but the graphs don't do anything and it looks like something isn;t getting resolved as when I create a graph with these templates I get this message.

Created Graph - server1 - Temperature - |query_templmsensorsdevice|

Any ideas anyone?
fvant
Posts: 2
Joined: Mon Dec 05, 2005 10:31 am

Post by fvant »

I tried to read the hd temps, following the example in the post here but .54 is not available. lm_sensors is compiled in as i get loads of other stuff, just not the hd temps.

snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.54
UCD-SNMP-MIB::ucdavis.54 = No Such Object available on this agent at this OID
dustsmoke
Posts: 2
Joined: Wed Dec 21, 2005 4:14 am

Post by dustsmoke »

Is there any way to get an export of these scripts for 0.8.6c? I have an older version of cacti that wont import these templates due to hash errors. The cacti version that I am using is packaged with debian stable/sarge. Other than that I have SNMP and lm_sensors configured and ready if I could just get at these templates. :)

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

Post by ehall »

sf_alpha wrote: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
The problem is that GUAGE types can only be positive. The CDEF below works by subtracting the current value from 4294967295 (the maximum 32-bit value), and then multiplying the result by -.001

Code: Select all

cdef=4294967295,CURRENT_DATA_SOURCE,-,-.001,*
That produces the difference value, and then makes it negative with the right decimal scope.
The00Dustin
Posts: 24
Joined: Thu Jan 05, 2006 5:52 pm

Error Compiling

Post by The00Dustin »

I am running CentOS 4. When I download the latest NetSNMP source and try to compile I get the following error...
configure: error: asked to use lm_sensors but I couldn't find -lsensors
First I was getting an error "can't find sensors/sensors.h" so I copied the /usr/include/linux/sensors.h to a new folder named /usr/include/sensors. What do I need to do so -lsensors can be found?
The00Dustin
Posts: 24
Joined: Thu Jan 05, 2006 5:52 pm

Re: Error Compiling

Post by The00Dustin »

The00Dustin wrote:I am running CentOS 4. When I download the latest NetSNMP source and try to compile I get the following error...
configure: error: asked to use lm_sensors but I couldn't find -lsensors
First I was getting an error "can't find sensors/sensors.h" so I copied the /usr/include/linux/sensors.h to a new folder named /usr/include/sensors. What do I need to do so -lsensors can be found?
I figured my own problem out. Turns out lm_sensors-devel was not installed. I didn't realize it was missing because yum didn't list it at all (as installed or available).
sf_alpha
Posts: 9
Joined: Fri Jul 01, 2005 10:36 am

Post by sf_alpha »

ehall wrote:
sf_alpha wrote: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
The problem is that GUAGE types can only be positive. The CDEF below works by subtracting the current value from 4294967295 (the maximum 32-bit value), and then multiplying the result by -.001

Code: Select all

cdef=4294967295,CURRENT_DATA_SOURCE,-,-.001,*
That produces the difference value, and then makes it negative with the right decimal scope.
But I'm working on 64bit systems and it must be subtract by a VERY BIG (2^64) value with different from 32bits system (2^32).

Have to split 2 version of CDEF for this, 32bit and 64bit ?!?
PYDou
Posts: 1
Joined: Sat Jan 21, 2006 10:37 am
Location: Lyon, France

Problem to graph CPT Temp

Post by PYDou »

Hi,

I use Cacti since a few month, and appreciate it.

I recently tried tu use Cacti to graph CPU temp, but it seems to be inpossible...

I use :
Debian Testing (Etch) Kernel 2.6.12 and packages obtained by apt-get
Snmp & snmpd 5.2.1.2
Cacti 0.8.6f
Lm-sensors


The sensors command is Ok

...
M/B Temp: +34°C (low = +15°C, high = +40°C) sensor = thermistor
CPU Temp: +45°C (low = +15°C, high = +45°C) sensor = thermistor
Temp3: +39°C (low = +15°C, high = +45°C) sensor = thermistor

The snmpwalk & snmpget command gives good result

Linux:/# snmpwalk localhost 1.3.6.1.4.1.2021.13.16.2.1
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: M/B Temp
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: CPU Temp
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: Temp3
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 34000
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 46000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 39000

Linux:/# snmpget localhost 1.3.6.1.4.1.2021.13.16.2.1.3.2
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 45000


I tried different methods to graph CPU temp

1) : Obtain OID value by SNMP Generic OID : With this method, i obtain a flat graph, with a constant value of 0. Looking at the Cacti Log, i can see that the OID is polled and the value obtained.

01/21/2006 02:25:18 PM - CMDPHP: Poller[0] Host[6] DS[53] SNMP: v1: localhost, dsname: snmp_oid, oid: 1.3.6.1.4.1.2021.13.16.2.1.3.2, output: 45000


When i try to change the value OID to an index OID (ex 1.3.6.1.4.1.2021.13.16.2.1.1.2) , the graph gives the correct value. The only difference between value OID and index OID is the format : Gauge 32 for temp, and INTEGER for index.


2) : Creating a new template based on Generic OID, including CDEF function to divide result by 1000 : Same result

3) : Using lmsensors sripts described on this forum : With this method, i dont obtain any graph !!!

I copyed the xml file in the correct path and imported the templates (net-snmp_lm_sensors_temp.xml) for snmp-queries, data-templates & graph templates .... Ok

I added the templates ucd/net - lm_sensors Temperature to the “linux local machine” host template
(in associated data queries section).

All the parameters seems to be Ok. When i createed the host, Cacti found the xml file and the sensors :

----------------------------------------------------------------------------------
Linux-2 (127.0.0.1)
SNMP InformationSystem: Linux Linux 2.6.12-1-386 #1 Tue Sep 27 12:41:08 JST 2005 i686Uptime: 66952Hostname: Linux *Create Graphs for this Host

Devices [edit: Linux-2]

DescriptionGive this host a meaningful description.
HostnameFill in the fully qualified hostname for this device.
Host TemplateChoose what type of host, host template this is. The host template will govern what kinds of data should be gathered from this type of host.
Disable HostCheck this box to disable all checks for this host. Disable Host
SNMP Options
SNMP CommunityFill in the SNMP read community for this device.
SNMP Username (v3)Fill in the SNMP v3 username for this device.
SNMP Password (v3)Fill in the SNMP v3 password for this device.
SNMP VersionChoose the SNMP version for this host.
SNMP PortEnter the UDP port number to use for SNMP (default is 161).
SNMP TimeoutThe maximum number of milliseconds Cacti will wait for an SNMP response (does not work with php-snmp support).


Associated Graph Templates

Graph Template Name Status
1) Linux - Memory Usage Is Being Graphed (Edit)
2) SNMP - Get Linux Temp Is Being Graphed (Edit)
3) Unix - Load Average Is Being Graphed (Edit)
4) Unix - Logged in Users Is Being Graphed (Edit)
5) Unix - Processes Is Being Graphed (Edit)
Add Graph Template:



Associated Data Queries

Data Query Name Debugging Re-Index Method Status
1) SNMP - Interface Statistics (Verbose Query) Uptime Goes Backwards Success [35 Items, 4 Rows]
2) ucd/net - Get lm_sensors Temperature (Verbose Query) Uptime Goes Backwards Success [6 Items, 3 Rows]
3) Unix - Get Mounted Partitions (Verbose Query) Uptime Goes Backwards Success [4 Items, 2 Rows]
Add Data Query: Re-Index Method:




----------------------------------------------------------------------------------



Linux-2 (127.0.0.1) Local Linux Machine

Create new graphs for the following host: *Edit this Host*Create New Host

Graph Templates

Graph Template Name
Create: Linux - Memory Usage
Create: SNMP - Get Linux Temp
Create: Unix - Load Average
Create: Unix - Logged in Users
Create: Unix - Processes
Create:



Data Query [SNMP - Interface Statistics]

Index Status Description Name (IF-MIB) Alias (IF-MIB) Type Speed Hardware Address IP Address
1 1 lo lo 24 10000000 127.0.0.1
2 1 eth0 eth0 6 100000000 00:D0:09:AD:6F:2C 192.168.0.55
3 1 eth1 eth1 6 100000000 00:05:1B:00:47:63 192.168.1.55
4 2 sit0 sit0 131 0
Select a graph type:


Data Query [ucd/net - Get lm_sensors Temperature]

Index Device
0 M/B Temp
1 CPU Temp
2 Temp3


Data Query [Unix - Get Mounted Partitions]

Device Name Mount Point
/dev/hda1 /
/dev/hda5 /home

-------------------------------------------------------------------------------

but ... no temperature graph




The snmp configuration is shown below

UCD-SNMP-MIB::versionIndex.0 = INTEGER: 1
UCD-SNMP-MIB::versionTag.0 = STRING: 5.2.1.2
UCD-SNMP-MIB::versionDate.0 = STRING: $Date: 2004/01/27 17:24:26 $
UCD-SNMP-MIB::versionCDate.0 = STRING: Sat Jan 21 15:55:34 2006
UCD-SNMP-MIB::versionIdent.0 = STRING: $Id: versioninfo.c,v 5.2 2004/01/27 17:24:26 slif Exp $
UCD-SNMP-MIB::versionConfigureOptions.0 = STRING: "'--prefix=/usr' '--sysconfdir=/etc' '--mandir=/usr/share/man' '--with-persistent-directory=/var/lib/snmp' '--enable-ucd-snmp-compatibility' '--enable-shared' '--with-cflags=-O2 -D_REENTRANT' '--with-perl-modules=INSTALLDIRS=vendor' '--enable-ipv6' '--with-logfile=none' '--without-rpm' '--with-libwrap' '--with-openssl' '--without-dmalloc' '--without-efence' '--without-rsaref' '--with-sys-contact=root' '--with-sys-location=Unknown' '--with-mib-modules=host smux ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/lmSensors' '--enable-mfd-rewrites' '--with-defaults'"

The SYSLOG file don’t show any error

...
Jan 21 16:00:22 Linux snmpd[4210]: Connection from UDP: [127.0.0.1]:32779
Jan 21 16:05:21 Linux snmpd[4210]: Connection from UDP: [127.0.0.1]:32779
...


What’s wrong
rking
Posts: 4
Joined: Mon Jan 09, 2006 10:03 am

Post by rking »

Worked great for me without any hassles. Just posting to say thanks very much for the templates!
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Re: Problem to graph CPT Temp

Post by redcap »

PYDou,

I had the same symptoms with another template: flat lines although snmpwalk turned valid results.
Im also using Debian Sarge testing, and cacti 0.8.6h (unstable package)

When looking at the mysql database with phpmyadmin, I found out that the OID values were empty. I completet them manually,, and that solved it for me.
Maybe this is also the solution for you.
lisa_parma
Posts: 18
Joined: Wed Jan 18, 2006 2:55 am
Location: indonesia
Contact:

Post by lisa_parma »

hi,all

i'm not using lm-sensor
but i want to create graph for my netguardian temperature's
when i use snmpwalk for the OID temperature, i get this value

.1.3.6.1.4.1.2682.1.2.2.1.5.99.1.10 = STRING: "........ 21.5035"

the real temperature is 21.5035 celsius
the problem here is when i run my snmpwalk for the OID temperature
i got value "........ 21.5035"
i dont understand, how can i get the real temperature value< 21.5035 not "........ 21.5035">

please help me to solve this problem, so i can graph for the temperature of my netguardian

thx b4:)
geefour
Posts: 11
Joined: Wed Apr 19, 2006 11:54 am

Post by geefour »

Hi, I'm getting this response when running a verbose query on cacti-0.8.6h looking for lm-sensors fan speed... this is the first one I've installed of the lm-sensors templates so I presume the others will have the same response.

Code: Select all

+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti-0.8.6h/resource/snmp_queries/net-snmp_lm_sensors_fan.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.13.16.3.1.1'
+ Located input field 'lmFanSensorsIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.13.16.3.1.1'
+ Found item [lmFanSensorsIndex='No Such Instance currently exists at this OID'] index: 1 [from value]
+ Located input field 'lmFanSensorsDevice' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.13.16.3.1.2'
+ Found item [lmFanSensorsDevice='No Such Instance currently exists at this OID'] index: 2 [from value]
+ Found data query XML file at '/var/www/html/cacti-0.8.6h/resource/snmp_queries/net-snmp_lm_sensors_fan.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.6h/resource/snmp_queries/net-snmp_lm_sensors_fan.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.6h/resource/snmp_queries/net-snmp_lm_sensors_fan.xml'

My snmpd.conf is very limited, only has

Code: Select all

rocommunity public
Disks /
so I'm wondering if that needs to be added to, to allow for lm_sensor monitoring.

Any ideas?
gotchi
Posts: 9
Joined: Mon Jul 31, 2006 11:47 am
Location: Austria
Contact:

Post by gotchi »

dustsmoke wrote:Is there any way to get an export of these scripts for 0.8.6c? I have an older version of cacti that wont import these templates due to hash errors. The cacti version that I am using is packaged with debian stable/sarge. Other than that I have SNMP and lm_sensors configured and ready if I could just get at these templates. :)

Thanks.
hi is therer a version vor 0.8.6c ? did you made lm sensors run and how ?

thanks
aashley
Posts: 1
Joined: Wed Sep 20, 2006 10:37 pm

Post by aashley »

does anyone have exports of the data queries to make these templates actually work?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests