Help required to create a custom CDEF.

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

Moderators: Developers, Moderators

Post Reply
stu_77
Posts: 28
Joined: Wed Aug 16, 2006 8:41 pm

Help required to create a custom CDEF.

Post by stu_77 »

I would like to create a CDEF to subtract the last data integer collected by Cacti from the current data integer and graph the difference. Can someone please help as I have read the CDEF tutorial but it is not clear on how to do this or even if this is possible using CDEF's.

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

Post by gandalf »

This kind of calculation is done automatically when applying COUNTER or DERIVE as the data source type. You may even try PREV, see http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html
Reinhard
stu_77
Posts: 28
Joined: Wed Aug 16, 2006 8:41 pm

Post by stu_77 »

Hi thanks very much for getting back to me, this is very helpful. I have another query regarding Cacti and CDEF's and wonder if you can help me. I am trying to create a graph to calculate total IP Sec usage across a Cisco Pix and need to calculate a sum of (IPSecOctetsIn*8*100)/(Uptime*ifSpeed). I have tried to get a CDEF SUM that is a*8*100/b*c but it does not seem to work because I have to graph a=IPSecOctetsIn, b=Uptime and c=ifSpeed instead of just the output of the calculation.

Can you please point me in the right direction?

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

Post by gandalf »

stu_77 wrote:...need to calculate a sum of (IPSecOctetsIn*8*100)/(Uptime*ifSpeed)
Sorry, but I have a major problem with your statement. You formulae obviously does not describe a SUM. Do you want to perform the maths above for each interface and sum each of those results? Is the (Uptime*ifSpeed) meant to build sth like a "maximum possible transfer amount"? Why don't you stick to intervals, e.g. build a relation between the "IPSecOctetsIn of last polling interval" and "interface speed"?
Reinhard
stu_77
Posts: 28
Joined: Wed Aug 16, 2006 8:41 pm

Post by stu_77 »

Hi sorry,

I am trying to calculate the input utilisation but substituting ipsecInOctets for ifInOctets.

Thanks
Attachments
calculate_bandwidth_snmp3.gif
calculate_bandwidth_snmp3.gif (2.55 KiB) Viewed 4140 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Ok. "Delta of ipsecInOctets with respect to polling interval" will already be built by rrdtool when using COUNTER as a data source type. This covers with lots of possible inaccuracies, refer to http://www.rrdtool.org
|query_ifSpeed| is a cacti pseudo-variable holding the ifSpeed of the current interface (with respect to the last re-indexing, so be careful to change indices without reboot ...). So your CDEF may look like
CDEF=CURRENT_DATA_SOURCE,8,100,*,*,|query_ifSpeed|,/
or

CDEF=CURRENT_DATA_SOURCE,800,*,|query_ifSpeed|,/

Reinhard
stu_77
Posts: 28
Joined: Wed Aug 16, 2006 8:41 pm

Post by stu_77 »

Thanks for this it helps a great deal and I will have a play.

I have another question regarding cacti. I am currently trying to migrate cacti from one server to another the only difference being that the second cacti server is running mysql-4.1 and the cactid-0.8.6g. Both are this is on a RH9 platform using cacti-0.8.6h but I can not get the fresh install minimal install on the new server to accept any cacti templates. Every time I try and upload I get the dreaded "XML Parse Error" I have check the php.ini and uploads are allowed. I have also compared the php builds on both servers and they are the same. Everything else is working fine with this new build.

Can you please help as I ready to through myself out the window.
:(
stu_77
Posts: 28
Joined: Wed Aug 16, 2006 8:41 pm

Post by stu_77 »

This XML Parse Error masteriously rectified its self.

I rebuilt MySQL to v4.1 from 4.0 had same problem occur then I left it for about 6hours while I slept and it was working. :)

I did patch cacti and change the poller to run as root but I can not see how that would have sorted the issue.
sebastian81
Posts: 2
Joined: Tue Oct 10, 2006 8:55 am

Re: Help required to create a custom CDEF.

Post by sebastian81 »

Hi!

I've got the same problem like stu_77!
stu_77 wrote:I would like to create a CDEF to subtract the last data integer collected by Cacti from the current data integer and graph the difference. Can someone please help as I have read the CDEF tutorial but it is not clear on how to do this or even if this is possible using CDEF's.

Thanks in advance.
lvm wrote:This kind of calculation is done automatically when applying COUNTER or DERIVE as the data source type. You may even try PREV, see http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html
Reinhard
I switched the data source type to COUNTER, but I still have get shown the current value and no substraction.

I hope you can help me.

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

Post by gandalf »

Changes to a Data Template will NOT automatically be applied to already existing rrd files. But this type of change can be applied using rrdtool tune --data-source-type
Reinhard
sebastian81
Posts: 2
Joined: Tue Oct 10, 2006 8:55 am

Post by sebastian81 »

Thanks, that's it!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest