Ad Widget

Collapse

Aggregate bandwidth of different interfaces

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inc0
    Member
    • Dec 2010
    • 36

    #1

    Aggregate bandwidth of different interfaces

    Hello,

    I'm trying to make zabbix generate an aggregate graph of the bandwidth used by different hosts.
    I have created an hostgroup with the hosts I need to monitor but here is the problem: my hosts use different interfaces to comunicate: some use eth0, some eth1 and some other bond0.
    The function I'm using to get the data to create the aggregate graph is:
    Code:
    grpsum["MyHostGroup","net.if.in[eth0,bytes]","last","0"]
    which collects data only from eth0 (in this case).
    As you can imagine, hosts using eth1 or bond don't return any data so the graph generated is unreliable.
    So here is my question: how can I generate an aggregate graph of bandwidth usage of hosts that comunicate/"send data" using different network interfaces?

    Sorry about my terrible english, I hope my problema is clear

    Thanks in advance.


    Inc0
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    I am afraid that you can't do that with aggregate function.

    The only workaround I can imagine is to create an aggregate item per interface name and a calculated item that will sum them.

    Something like:
    eth0_aggregate : grpsum["MyHostGroup","net.if.in[eth0,bytes]","last","0"]
    eth1_aggregate : grpsum["MyHostGroup","net.if.in[eth1,bytes]","last","0"]
    bond0_aggregate : grpsum["MyHostGroup","net.if.in[bond0,bytes]","last","0"]

    all_aggregate : last(eth0_aggregate)+last(eth1_aggregate)+last(bon d0_aggregate)

    regards,
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • Inc0
      Member
      • Dec 2010
      • 36

      #3
      Thanks for you reply but i still need help.
      Originally posted by alixen
      Hi,

      I am afraid that you can't do that with aggregate function.

      The only workaround I can imagine is to create an aggregate item per interface name and a calculated item that will sum them.
      OK; just a small note: there seems to be a problem working with bond-interfaces. If I create a function like
      Code:
      bond0_aggregate : grpsum["MyHostGroup","net.if.in[bond0,bytes]","last","0"]
      I don't get any value and zabbix_server.log reports error but forget it at the moment since I'm not going to use it right now.

      Something like:
      eth0_aggregate : grpsum["MyHostGroup","net.if.in[eth0,bytes]","last","0"]
      eth1_aggregate : grpsum["MyHostGroup","net.if.in[eth1,bytes]","last","0"]
      bond0_aggregate : grpsum["MyHostGroup","net.if.in[bond0,bytes]","last","0"]

      all_aggregate : last(eth0_aggregate)+last(eth1_aggregate)+last(bon d0_aggregate)

      regards,
      Alixen
      I tried to implement your solution but i failed Here is what I've done:
      - created a new template: MyTemplate
      - inserted into MyTemplate 2 hosts (both have eth0 and eth1)
      - created a new hostgroup: MyHostGroup
      - inserted into MyHostGroup the same hosts inserted into MyTemplate
      - in MyTemplate I created 3 new items:
      eth1_aggregate_out with key grpsum["MyHostGroup","net.if.out[eth1,bytes]","last","0"]
      eth0_aggregate_out with key grpsum["MyHostGroup","net.if.out[eth0,bytes]","last","0"]
      all_aggregate as calculated item with formula last("eth0_aggregate_out")+last("eth1_aggregate_ou t") and key BOA
      - created a new graph using BOA as data source but legend keep reporting no data

      checking zabbix_server.log it reports:
      Code:
      29392:20101209:150712.019 Item [host1:BOA] error: Can not evaluate function [last()]: item [host1:eth0_aggregate_out] not found
       29392:20101209:150712.019 Parameter [host1:BOA] is not supported, old status [0]
       29392:20101209:150713.049 Item [host2:BOA] error: Can not evaluate function [last()]: item [host2:eth0_aggregate_out] not found
       29392:20101209:150713.049 Parameter [host2:BOA] is not supported, old status [0]
      Thanks again for your support.

      Comment

      • Inc0
        Member
        • Dec 2010
        • 36

        #4
        I've found another workaround: I don't like it that much because it requires "too much work" just to add an host but meanwhile it's better than nothing.

        My "ugly" workaround consists of making a new item that define a new key, called for instance MyKey, in an host using a calculated item which return a float number as result of the following operation:

        last("firstHostToMonitor:net.if.out[eth0,bytes]") + last("firstHostToMonitor:net.if.out[eth1,bytes]") + last("secondHostToMonitor:net.if.out[eth0,bytes]") + last("secondHostToMonitor:net.if.out[eth1,bytes]")

        Please refer to http://www.zabbix.com/documentation/...lculated_items for more specific informations.

        At this point you can use MyKey to create triggers and graphs.


        I don't like it because if I want to add a new host I have to modify the function manually specifing the hostname instead of just adding the host to a template.
        Last edited by Inc0; 10-12-2010, 15:33. Reason: typo

        Comment

        Working...