No announcement yet.

Calculate 1 hour bandwith on interface

  • Filter
  • Time
  • Show
Clear All
new posts

    Calculate 1 hour bandwith on interface


    I want to calculate item that mesute total amount of Gb transferred through interface

    I created an item last("[{$IF1},bytes]",3600) whitch should store value from 1 hour of traffic on interface and also make another item which subtract this value from current total value, but it seams don't working.

    Could You help me? Because I dont't have any ideas how to do it.

    Best Regards

    You don't need to calculate this.
    Every full our each numeric metric has calculated trends point stored in trends (float) or trends_uint (integer) tables and each of those point consist fron three values: min, max and avg all values in last hour.
    zapish - Zabbix API SHell binding
    My zabbix templates


      If you're looking for the total bandwidth over one hour you have two basic codes.
      1) take the average bps over a one hour period and multiply it by 3600 (1 hour) or
      2) create a new item for the interface in question and have it collect once per hour and set it to perform a simple delta

      The first will not be accurate but an under approximation. The second will overall be the most accurate, but might suffer from time jitter making your data period more than one hour, though often only a few seconds.
      RHCE, author of zbxapi
      Ansible, the missing piece (Zabconf 2017):
      Zabbix and SNMP on Linux (Zabconf 2015):


        Thanks for respond I find out where I made a mistake when I was creating an item

        In manual on zabbix website there is information last (sec|#num,<time_shift>) an it says that parameter sec is ignored but it's not, You need to write there something so I added another comma to my calculation an now it's look like this "last("[{$IF1},bytes]")-last("[{$IF1},bytes]",,1h)" and work perfect.

        I someone will have similar problem try to add another comma

        Best regards


          You are awesome ..!!

          Hi cosmo222,

          I need the same solution to get monthly bandwidth utilization to bill our client, could you please share step by step process to get the total bandwidth month-wise ??