Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have cacti with a lot of graphs (interface statistics) and I need show the difference between two of them. Something like traffic=traffic1-traffic2 where traffic1 and traffic2 are interfaces on two separate switches.

Is it possible?

share|improve this question
up vote 2 down vote accepted

Yes, its possible. For a good example of a similar, but not exactly the same, howto read the following thread and examples:

share|improve this answer
looks like not the same. I dont whant 1 graph with several lines, i want 1 graph with 1 line wich calculated as operation on another 2 graphs – Korjavin Ivan Jan 19 '12 at 7:21
Its the same idea. Its just another CDEF calculation! Read the examples and modify according to your needs! – Mattias Ahnberg Jan 19 '12 at 7:49
Check the link from the post I pasted above, and you will come to where you find section 7 a long CDEF. You have to make it a,b,- or whatever keys your values will get. Then you will have a new total, and you graph this as one single line in the new graph, just as you ask for! – Mattias Ahnberg Jan 19 '12 at 7:51
thank you. I think you right, but i really stupid and after tons of try cant do that. Looks like i need "cdefs steb by step for idiots" – Korjavin Ivan Jan 24 '12 at 8:49
Maybe or can be a good beginning for you? :) Good luck! Its a really powerful tool, so I am sure you will do it with some practice! – Mattias Ahnberg Jan 24 '12 at 10:55

Yes. You need to create a custom cdef.

Assuming the DEFs are as such Total = a Used = b The cdef=a,b,- should do. It is position dependant; that's bad. But the cure, a COMPUTE data source, will not be introduced until cacti 088 Reinhard

Go to Graph Management->CDEFs

Take a look at

Total All Data Sources


x Negate CDEF


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.