ZABBIX Forums  
Old 07-12-2017, 09:54
cosmo222 cosmo222 is offline
Junior Member
Join Date: Dec 2017
Posts: 3
Default 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
Reply With Quote
Old 07-12-2017, 11:09
kloczek kloczek is offline
Senior Member
Join Date: Jun 2006
Location: UK/London
Posts: 910

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.
Reply With Quote
Old 07-12-2017, 15:24
nelsonab nelsonab is offline
Senior Member
Zabbix certified professionalZabbix certified specialist
Join Date: Sep 2006
Location: Virginia
Posts: 1,220

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):

Reply With Quote
Old 11-12-2017, 09:58
cosmo222 cosmo222 is offline
Junior Member
Join Date: Dec 2017
Posts: 3

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
Reply With Quote
Old 03-01-2018, 21:20
[email protected] is offline
Junior Member
Join Date: Jan 2018
Posts: 2
Default 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 ??
Reply With Quote

bandwidth usuage, item create, netwok

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:25.