functin to sum traffic of 2 interfaces

is it possible to make chart(i need function first), with sum of traffic of 2 interfaces
a. when both interfaces are on the same RB
b. when interfaces are one different RB?

You can have chart with two different sources, that will be displayed on the same graph. But there will not be sum for these graphs.

I’ve made it this way, i have 2 WAN, and i want to see summary traffic.

  1. Create new datasource
    datasource.png
    The code should be
round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.1","5","300","192.168.0.250","Cisco"))*8) +
rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.2","5","300","192.168.0.244","Cisco"))*8))

This code will return sum of bitrate for inbound interface rate on 2 devices with IP 192.168.0.250 (interface index 1) and IP 192.168.0.244 (interface index 2). For more information check functions description in The Dude function tab.
2) Create new datasource for outbound traffic. The code will change to

round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.16.1","5","300","192.168.0.250","Cisco"))*8) +
rate(diff32(oid("1.3.6.1.2.1.2.2.1.16.2","5","300","192.168.0.244","Cisco"))*8))
  1. Put new created datasources on chart.
  2. Enjoy. :smiley:

well, thanks, almost ok, i’ve got question about units, where i’m wrong:

oid("1.3.6.1.2.1.2.2.1.16.1") - Bytes
diff32(oid("1.3.6.1.2.1.2.2.1.16.1")) - difference in Bytes
diff32(oid("1.3.6.1.2.1.2.2.1.16.1"))*8 - difference in bits
rate(diff32(oid("1.3.6.1.2.1.2.2.1.16.1"))*8) - rate in bit/s

I thought, that last line should be equal to built in function: bitrate of this intercafe(bit/s), but my result is still 8 or 10 times smaller, where’s mistake?

Not any mistake.
Take a look at this
rate_bitrate.png

concatenate("Rate is: ",round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.1"))*8))," ;Bitrate is: ",bitrate(round(rate(diff32(oid("1.3.6.1.2.1.2.2.1.10.1"))*8))))

Bitrate is doing exatly what it should “formats number as bitrate”. But on a chart you should put “raw” values.

You were very helpfull again, thanks, it was my mistake i was looking on upload:

"1.3.6.1.2.1.2.2.1.16.1"

when i need download:

"1.3.6.1.2.1.2.2.1.10.1"

Now it’s OK thx.

Hello, can you please provide code for the sum of 2 interfaces on the same router?

useful topic

thanks for the info

i used to graph queue tree