Announcement

Collapse
No announcement yet.

Scripting in calculated item formula?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    Hi,

    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
    http://www.alixen.fr/zabbix.html

    Comment


      #3
      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.

      Comment

      Working...
      X