Help to divide two independent graphs-Rate(Division)

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Help to divide two independent graphs-Rate(Division)

Post by tkis »

Hi everybody,

I am working on a project, and I want to divide the result of two independent graphs(OID) from the same node in order to find the rate. I try to create a CDEF but it did NOT work.

I was able to add the two graphs but NOT divide them.
Any suggestions?
Can you please tell me how to achieve it?

Thanks in advance!

http://www.blwebhosting.com.cy/
Last edited by tkis on Wed Sep 09, 2009 8:50 am, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post the rrdtool graph statement for that graph from Graph Management in DEBUG mode
Reinhard
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Rate of two graphs

Post by tkis »

Hi,
the rrdtool graph statement for that graph from Graph Management says:

ERROR: invalid rpn expression in : 100, / , 100

Thanks in advance

http://www.blwebhosting.com.cy/
Last edited by tkis on Wed Sep 09, 2009 8:50 am, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Not correct. That's the result of performing the command, not the command itself. The line starts with sth like "/usr/local/bin/rrdtool graph - /" ...
Reinhard
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Post by tkis »

Sorry for misunderstanding. Below is the rrdtool graph statement that you request.

Thanks in advance.

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="Rate" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
DEF:a="/srv/www/htdocs/cacti-0.8.6i/rra/test_1_snmp_oid_198.rrd":snmp_oid:AVERAGE \
DEF:b="/srv/www/htdocs/cacti-0.8.6i/rra/test_1_snmp_oid_211.rrd":snmp_oid:AVERAGE \
CDEF:cdefc=100,/,100 \
LINE1:a#FF4105:"" \
LINE1:b#CCBB00:"" \
LINE3:cdefc#000000:""

RRDTool Says:

ERROR: invalid rpn expression in: 100,/,100


http://www.blwebhosting.com.cy/
Last edited by tkis on Wed Sep 09, 2009 8:54 am, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Ok, fine. This CDEF is indeed invalid. But I can't guess what you wanted to get from it. Do you want to divide each daat source by 100?
Reinhard
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Post by tkis »

Hi Reinhard,

The task that I am try to accomplish is to divide two values from two different graphs in order to find their rate.

In other words, I want to divide the values 98005 / 101219 and create a new graph shown the result. See graphs below.

Thanks in advance.
Attachments
graph_2.GIF
graph_2.GIF (10.96 KiB) Viewed 1992 times
graph_1.GIF
graph_1.GIF (11.07 KiB) Viewed 1992 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, rewrite your cdef to cdef=a,b,/, where a references data of your "graph-1"
Reinhard
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Post by tkis »

Hello again Reinhard,

I manage to create the devision graph but again the result of the division is wrong because i cannot create a CDEF that can divide two different graphs. The result of the division is 1 because i devide the graph with itself.(cdefe=b,b,/ ) See attachment.

How can i remove a "b" and add "a" ?

Can you please outline step by step how can achive that from the graphical inetrface?

Thanks in advance.
Attachments
graph_to1rrdfile.txt
(642 Bytes) Downloaded 106 times
graph_to1.GIF
graph_to1.GIF (10.2 KiB) Viewed 1956 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

tkis wrote:Hello again Reinhard,

I manage to create the devision graph but again the result of the division is wrong because i cannot create a CDEF that can divide two different graphs. The result of the division is 1 because i devide the graph with itself.(cdefe=b,b,/ ) See attachment.
Well, perhaps I was not plain enough.
Please create a new CDEF. Provide a nice name. Add a new CDEF item, type is CUSTOM. Enter the string a,b,/ and save.
Then, visit your Graph Template. Select the Graph Item that shall graph the result of the math (if not yet in place, add a new graph item). Associate a data source of NONE, LINE1, a nice color, AVERAGE and your new CDEF. Provide some text for the legend.
That's it
Reinhard
tkis
Posts: 20
Joined: Thu Dec 07, 2006 7:59 am

Post by tkis »

Reinhard,

Finally, I manage to do it!
Many thanks for your helpful comments and support.

Thanks,
tkis

http://www.blwebhosting.com.cy/
akkrle
Posts: 2
Joined: Mon May 16, 2011 4:13 am

Re: Help to divide two independent graphs-Rate(Division)

Post by akkrle »

Hello,

We are trying to create a graph which should represent the result of division of two independent graphs. Namely, both are aggregated graphs (not bound to any host). The first graph represents interface traffic (interface traffic-bits/sec template) and the second one number of sessions (generic OID template). We need to get a graph which represents average bandwidth per session (in bits/sec).
We already created CDEF (cdef=a,b,/). Now we need help with graph creation (graph template, etc.), because it's not clear how to get to the point where we are asked which graphs to divide...

Thanks in advance.

BR
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests