ZABBIX Forums  
  #1  
Old 29-09-2010, 08:37
Surge Surge is offline
Junior Member
 
Join Date: Sep 2010
Posts: 16
Question Scripting in calculated item formula?

I'm trying to calculate bandwidth for an interface on an SNMP device.
I'm using a calculated item with the following formula to get bits per minute (item read every 60 secs):
(last(ifInOctets3,#1)-last(ifInOctets3,#2))/60

It works perfectly except when the 32-bit or 64-bit counters wrap around.
Is there any way to use some sort of logical scripting in the formula?
Having huge spikes in my bandwidth graphs are not an option - I need to calculate the values accurately.
This is the only thing stopping me from retiring cacti.
Reply With Quote
  #2  
Old 29-09-2010, 10:06
alixen alixen is offline
Senior Member
 
Join Date: Apr 2006
Location: Paris, France
Posts: 462
Default

Hi,

Quote:
Originally Posted by Surge View Post
I'm trying to calculate bandwidth for an interface on an SNMP device.
I'm using a calculated item with the following formula to get bits per minute (item read every 60 secs):
(last(ifInOctets3,#1)-last(ifInOctets3,#2))/60
I have no direct answer to your question but 2 remarks:
  • Your formula should give you bytes/s not bits/mn
  • If you want bytes/s, just let Zabbix do it
If you set your item with option "Store value" to "Delta (speed per second)" instead of "As is", Zabbix will store directly bytes/s, without spikes.
If you want bits/s, set "Use custom multiplier" to 8.

Regards,
Alixen
Reply With Quote
  #3  
Old 29-09-2010, 10:24
Surge Surge is offline
Junior Member
 
Join Date: Sep 2010
Posts: 16
Default

Thanks, I didn't know that the "Store delta (speed per second)" had the logic built in to handle wrapping counters. Would be nice if that crucial bit of detail was in the manual.
I use a multiplier of 8 to get bps but didn't mention it.

It would however still be nice to be able to do scripting in several areas of Zabbix such as
custom items, action conditions and trigger definitions.
With Zenoss you can do custom scripting in Python in the GUI to change the default behaviour of the objects.
Reply With Quote
Reply

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 09:04.