[HOWTO] Using Data Queries and Data Input Methods

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Geier0815
Posts: 13
Joined: Mon May 22, 2006 8:21 am

Post by Geier0815 »

http://www.geier0815.de/cacti/cacti_niedriger_load.log
http://www.geier0815.de/cacti/cacti_hoher_load.log

contains the full data of one polling cycle (5 min) with loglevel on DEBUG. One with low traffic and the other with high (~4MB) traffic on the testserver.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Interesting part of the first log is

Code: Select all

05/31/2006 12:10:05 PM - CMDPHP: Poller[0] Host[3] DS[33] SNMP: v1: testserver6.tng-lab.de, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 103031819
05/31/2006 12:10:05 PM - CMDPHP: Poller[0] Host[3] DS[33] SNMP: v1: testserver6.tng-lab.de, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 3744367078
05/31/2006 12:10:05 PM - CMDPHP: Poller[0] Host[3] DS[35] SNMP: v1: testserver6.tng-lab.de, dsname: ifOutOctets, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 103032002
05/31/2006 12:10:05 PM - CMDPHP: Poller[0] Host[3] DS[35] SNMP: v1: testserver6.tng-lab.de, dsname: ifInOctets, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 3744367252

and

05/31/2006 12:10:05 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/testserver6_traffic_in_33.rrd --template traffic_out:traffic_in 1149070203:103031819:3744367078
05/31/2006 12:10:05 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/testserver6_ifinoctets_35.rrd --template ifOutOctets:ifInOctets 1149070203:103032002:3744367252
and of the second is

Code: Select all

05/31/2006 12:45:07 PM - CMDPHP: Poller[0] Host[3] DS[33] SNMP: v1: testserver6.tng-lab.de, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 110122359
05/31/2006 12:45:07 PM - CMDPHP: Poller[0] Host[3] DS[33] SNMP: v1: testserver6.tng-lab.de, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 354639313
05/31/2006 12:45:07 PM - CMDPHP: Poller[0] Host[3] DS[35] SNMP: v1: testserver6.tng-lab.de, dsname: ifOutOctets, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 110125225
05/31/2006 12:45:07 PM - CMDPHP: Poller[0] Host[3] DS[35] SNMP: v1: testserver6.tng-lab.de, dsname: ifInOctets, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 355038917

and

05/31/2006 12:45:08 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/testserver6_ifinoctets_35.rrd --template ifInOctets:ifOutOctets 1149072303:355038917:110125225
05/31/2006 12:45:08 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/testserver6_traffic_in_33.rrd --template traffic_out:traffic_in 1149072303:110122359:354639313
From this we learn, that the same OIDs are polled and that quite the same readings are retrieved. From the data gathering point of view, everything is ok. And the rrdtool updates hold the correct data as well.

Now lets proceed to the rrd files themselves. Please perform

Code: Select all

rrdtool fetch <rrd> AVERAGE
and post the last ten lines for both rrd files. Then, please perform

Code: Select all

rrdtool info <rrd>
for both and post the first 20 lines of both.

Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

First, the ifInOctets MAXIMUM setting is wrong (must check my howto for that). Actually, it is set to 100, all other values will be clipped off. Please check the Data Template and use rrdtool tune to change the existing rrd
Second, the values stored by rrd (from fetch output) are exactly the same (I'm wondering 'bout that, they match up to the last decimal)
Reinhard
Geier0815
Posts: 13
Joined: Mon May 22, 2006 8:21 am

Post by Geier0815 »

First the screenshot from data-template: You can see, I haven't set a max. value. Could this be a bug in cacti?

www.geier0815.de/cacti/data_template_ifinoctets.jpg

Second the same values: ifInOctets is the same as traffic-in, why should they differ?


[edit] the maximum filesize is reached, so I had to post the picture to my webspace.[/edit]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Geier0815 wrote:First the screenshot from data-template: You can see, I haven't set a max. value. Could this be a bug in cacti?
The value seen (100) is the default max value. I suppose, this rrd was created with that MAX value set in the Data Template and that the Data Template was changed later on. But remember, that this change does not change existing rrd files. So please perform rrdtool tune --maximum ifInOctets:U <rrd file>
Second the same values: ifInOctets is the same as traffic-in, why should they differ?
As you may have noticed, both "basic" counter values were retrieved with a little difference in time. So the counters slightly differ. When storing them with rrdtool, this program calculates the difference between this and the previous value. And IMHO its merely by accident that the difference is exactly the same.
Reinhard
Geier0815
Posts: 13
Joined: Mon May 22, 2006 8:21 am

Post by Geier0815 »

Thank you, the hint with "rrdtool tune <rrd> --maximum ifInOctets:U" was the right! Now the graph show the right measures. You are great.
tomvo
Posts: 2
Joined: Mon Jun 26, 2006 11:29 am

conversion of 0.xxx to 'times 1000' ?

Post by tomvo »

Hi,

Excellent howto. I applied it and works fine.
One thing I fail to understand though:

the script output's the round trip time in milliseconds (e.g. 0.125 ms) and the output of the script is typically 0.111 or sth. like that.

the graphics show this value times 1000. where is this converson defined ? is it the base value (which seems to default to 1000) that I should interpret as:
the graph will show the output field * 'base value' ?

the official docs only explain for base value the difference between 1000 and 1024 (e.g. memory <-> disk space measurements).

Also, the graphics display a 'm' in the Y-axis, and in the legend.
e.g. current: 507.85m

Should I interpret this as 507.85 milli (milli whatever - taken from the parameter base value that was set to 1000) ?

thanks for clarifying this.

regards,
tom.
benekm
Posts: 1
Joined: Mon Jul 03, 2006 7:46 am

Thanks Ivm

Post by benekm »

This Howto, is the best I have seen about Cacti.
From now and on, Cacti things looks mutch clearer.

Best regards :D :D :D
//benekm
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: conversion of 0.xxx to 'times 1000' ?

Post by gandalf »

tomvo wrote:Also, the graphics display a 'm' in the Y-axis, and in the legend.
e.g. current: 507.85m

Should I interpret this as 507.85 milli (milli whatever - taken from the parameter base value that was set to 1000) ?
Please see http://forums.cacti.net/viewtopic.php?t=8168
Reinhard
Super-Mike
Posts: 23
Joined: Thu Jan 26, 2006 12:39 pm
Contact:

Post by Super-Mike »

Hi.
I created statistics on this documentation.
I cannot draw the second graph

pic0

Script issues the values: connect:830 lock:1143

Data Input Methods:

pic2

Data Templates:
pic3
pic3_1

Graph Templates:
pic4
Attachments
pic0
pic0
pic0.JPG (128.88 KiB) Viewed 32374 times
pic2
pic2
pic2.JPG (53.86 KiB) Viewed 32374 times
pic3
pic3
pic3.JPG (108.58 KiB) Viewed 32374 times
pic3_1
pic3_1
pic3_1.JPG (106.58 KiB) Viewed 32374 times
pic4
pic4
pic4.JPG (122.68 KiB) Viewed 32374 times
JasonKannte
Posts: 2
Joined: Mon Jul 24, 2006 10:03 pm

Post by JasonKannte »

:D Thank you!! So good works!
JasonKannte
Posts: 2
Joined: Mon Jul 24, 2006 10:03 pm

Post by JasonKannte »

:D Thank you!! So good works!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Super-Mike wrote:Script issues the values: connect:830 lock:1143

Data Input Methods:

pic2
You should've pay more attention to me saying that the default (100) of the second data source item should be removed (lock in your case). The type is GAUGE, the value is 1143 which clearly exceeds the MAXIMUM of 100 you've left in the data source item.
So please change this item and rrdtool tune the already existing rrd file(s)
Reinhard
Super-Mike
Posts: 23
Joined: Thu Jan 26, 2006 12:39 pm
Contact:

Post by Super-Mike »

My program (licq_connect.pl) gives only integers.
Why in the figure not integers?
Attachments
1k2.jpg
1k2.jpg (63.43 KiB) Viewed 32300 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests