ZABBIX Forums  
  #1  
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

Hi

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

I created an item last("net.if.in[{$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
Matthew
Reply With Quote
  #2  
Old 07-12-2017, 11:09
kloczek kloczek is offline
Senior Member
 
Join Date: Jun 2006
Location: UK/London
Posts: 872
Default

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
  #3  
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,213
Default

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): https://www.youtube.com/watch?v=R5T9NidjjDE
Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

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

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("net.if.in[{$IF1},bytes]")-last("net.if.in[{$IF1},bytes]",,1h)" and work perfect.


I someone will have similar problem try to add another comma


Best regards
Matthew
Reply With Quote
Reply

Tags
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 11:52.