Ad Widget

Collapse

Division by ZERO on a Zabbix 5.4 calculated item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • martinpedros
    Junior Member
    • Jun 2020
    • 4

    #1

    Division by ZERO on a Zabbix 5.4 calculated item

    Hi Team:

    I am generating a calculated item in Zabbix 5.4 with the following expression:

    HTML Code:
    100-(last(//SwapFree)/last(//SwapTotal))
    The problem is when the swap memory is equal to zero (SwapTotal = 0). I try to solve it with the following expression:

    HTML Code:
    100-(last(//SwapFree)/last(//SwapTotal)+ count("SwapTotal",#1,0))
    ... but I get the following error when I want to save:

    HTML Code:
    Invalid parameter "/1/params": incorrect expression starting from "count("SwapTotal",#1,0))"
    Could someone guide me on how to solve this division by zero?

    Thanks in advance.

    Martin Pedros
Working...