[HOWTO] How can I make SUM of graphs

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

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

Post by gandalf »

YEP, use aggregate plugin
R.
anastohamy
Posts: 4
Joined: Mon Mar 31, 2014 4:35 am

Re: sumation and diffrence

Post by anastohamy »

amir.shirazi wrote:How to graph the diffrence between in and out and sumation of ...


1. console -> Graph Management -> CDEFs -> Add

name: make zero
cdef=CURRENT_DATA_SOURCE,0,*

name:diff
cdef=8,b,a,-,*

name:total a+c & turn Bytes to bit
cdef=cdef=8,a,c,+,*

name:total b+d & turn Bytes to bit
cdef=cdef=8,a,c,+,*

2. console -> Graph Templates -> Add

name: gain
Graph Template Items -> Add

Item1:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: Make zero

Item2:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: Make zero
Item3:
Data Source: NONE
color: 0000FF
graph Item Type: LINE1
CEDF Function: diff
<insert hard return checked>
Item4:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:LAST
CEDF Function: diff
Text Format: Current:
<Insert Hard Return checked>

Item5:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:AVERAGE
CEDF Function: diff
Text Format: Average:

Item6:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:MAX
CEDF Function: diff
Text Format: Maximum:
<Insert Hard Return checked>
name: total-bw
Graph Template Items -> Add

Item1:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item2:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item3:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item4:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item5:
Data Source: NONE
color: 7EE600
graph Item Type: AREA
CEDF Function: total b+d & turn Bytes to bits

Item6:
Data Source: NONE
color: 55009D
graph Item Type: LINE2
CEDF Function: total a+c & turn Bytes to bits

NOTE: because Item5 is LINE and Item4 is Area we must create #5 before #6

Now in "Graph Item Inputs" we must add two item manually and adjust "Associated Graph Items" for each one
and thire name.

Data Source [traffic_in#1]
<Item #3: LINE1 (AVERAGE) checked>

Data Source [traffic_in#2]
<Item #1: LINE1 (AVERAGE) checked>

Data Source [traffic_out#1]
<Item #4: LINE1 (AVERAGE) checked>
<Item #6: LINE1 (AVERAGE) checked> ??

Data Source [traffic_out#2]
<Item #2: LINE1 (AVERAGE) checked>






3. console -> Graph Management -> Add
Selected Graph Template: gain
Choose the host that this graph belongs to.: NONE

Data Source: <choose desired one>
Data Source: <choose desired one>
-> Save


Selected Graph Template: total-bw
Choose the host that this graph belongs to.: NONE

Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
-> Save
Hi Dear I need exactly what you doing wanna get difference between two interfaces on one graph and did all steps but last steps I got lost the output graph is no PNG output without any error on cdefs or code could you help
anastohamy
Posts: 4
Joined: Mon Mar 31, 2014 4:35 am

Re: sumation and diffrence

Post by anastohamy »

amir.shirazi wrote:How to graph the diffrence between in and out and sumation of ...


1. console -> Graph Management -> CDEFs -> Add

name: make zero
cdef=CURRENT_DATA_SOURCE,0,*

name:diff
cdef=8,b,a,-,*

name:total a+c & turn Bytes to bit
cdef=cdef=8,a,c,+,*

name:total b+d & turn Bytes to bit
cdef=cdef=8,a,c,+,*

2. console -> Graph Templates -> Add

name: gain
Graph Template Items -> Add

Item1:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: Make zero

Item2:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: Make zero
Item3:
Data Source: NONE
color: 0000FF
graph Item Type: LINE1
CEDF Function: diff
<insert hard return checked>
Item4:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:LAST
CEDF Function: diff
Text Format: Current:
<Insert Hard Return checked>

Item5:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:AVERAGE
CEDF Function: diff
Text Format: Average:

Item6:
Data Source: NONE
color: none
graph Item Type: GPRINT
Consolidation Function:MAX
CEDF Function: diff
Text Format: Maximum:
<Insert Hard Return checked>
name: total-bw
Graph Template Items -> Add

Item1:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item2:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item3:
Data Source: Interface - Traffic- traffic_in
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item4:
Data Source: Interface - Traffic- traffic_out
color: none
graph Item Type: LINE1
CEDF Function: byte -> bits

Item5:
Data Source: NONE
color: 7EE600
graph Item Type: AREA
CEDF Function: total b+d & turn Bytes to bits

Item6:
Data Source: NONE
color: 55009D
graph Item Type: LINE2
CEDF Function: total a+c & turn Bytes to bits

NOTE: because Item5 is LINE and Item4 is Area we must create #5 before #6

Now in "Graph Item Inputs" we must add two item manually and adjust "Associated Graph Items" for each one
and thire name.

Data Source [traffic_in#1]
<Item #3: LINE1 (AVERAGE) checked>

Data Source [traffic_in#2]
<Item #1: LINE1 (AVERAGE) checked>

Data Source [traffic_out#1]
<Item #4: LINE1 (AVERAGE) checked>
<Item #6: LINE1 (AVERAGE) checked> ??

Data Source [traffic_out#2]
<Item #2: LINE1 (AVERAGE) checked>






3. console -> Graph Management -> Add
Selected Graph Template: gain
Choose the host that this graph belongs to.: NONE

Data Source: <choose desired one>
Data Source: <choose desired one>
-> Save


Selected Graph Template: total-bw
Choose the host that this graph belongs to.: NONE

Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
Data Source: <choose desired one(IN)>
-> Save
Hi Dear I need exactly what you doing wanna get difference between two interfaces on one graph and did all steps but last steps I got lost the output graph is no PNG output without any error on cdefs or code could you help
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests