Skip to content

Instantly share code, notes, and snippets.

View bradleeedmondson's full-sized avatar

Bradlee H. Edmondson bradleeedmondson

View GitHub Profile
@bradleeedmondson
bradleeedmondson / zero_division.md
Created March 30, 2021 18:01 — forked from limitusus/zero_division.md
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))