1

I have a trigger expression with 2 conditions in which first is a simple one but second is very expensive on CPU as it does some heavy calculation of averages:

(Condition A) AND (Condition B)

I am trying to use condition A to skip evaluation of condition B. But even when condition A results in false, zabbix still evaluates condition B. Anyway to prevent that?

Sam
  • 153

1 Answers1

0

I don't know Zabbix, but I used to work with another language that would not escape halfway through even if the result had already been determined to be false, it would always evaluate the entire line.

The workaround was to separate the two halves, allowing escape after the first.

if (condA) {
    if (condB)
    doTask(); 
    }
else return(); --optional

Bracketing out condition B would allow a FALSE result on condition A to just skip the bracketed section. You may or may not need the specific else return(), depending on how the language works.

Tetsujin
  • 50,917