Skip to content

Instantly share code, notes, and snippets.

View bradleeedmondson's full-sized avatar

Bradlee H. Edmondson bradleeedmondson

View GitHub Profile
@limitusus
limitusus / zero_division.md
Last active June 21, 2024 19:35
Zabbix: handle calculated item with zero division

Problem

Want to create a calculated item with last("X") / last("Y"). When Y = 0, the result should be 0.

Answer

last("X") * (1 - count("Y",#1,0)) / (last("Y") + count("Y",#1,0))