title: Zabbix trigger expression - detect a drop and stay in problem state
body: <p>I have this trigger that fires upon a match of the rule below:</p>
  
  <pre><code>{monitoring:test.item.change(0)}&lt;-100
  </code></pre>
  
  <p>When my graph goes down by over 100 units, an event gets created. The event should switch to OK status when the graph goes back up. The graph has different average values at different times of day and besides, the item is a trapper value, which does not support flexible intervals. My problem is this; when the graph falls by over 100 units, let's say from 300 to 10, a PROBLEM situation is created. At the next interval, if the value is still low (e.g 13), Zabbix creates an OK event, because although the value is still low, the expression does not return true because the graph hasn't gone down by a further 100 units. Any ideas on how I could fix this? I have been trying to use </p>
  
  <pre><code>{{monitoring:test.item.avg(1800)}-{monitoring:test.item.last(0)}&gt;100}
  </code></pre>
  
  <p>but Zabbix wouldn't take that expression. This is supposed to compare the last value of test.item to the average value of the past 30 minutes and raise an alert when the difference exceeds 100.</p>
  
  <p>This, I believe, would sort out my problem situation of a false OK status when the graph remains at a low value.</p>
  
  <p>EDIT: I think I have cracked it. Zabbix has accepted the below expression:</p>
  
  <pre><code>{monitoring:test.item.avg(1800)}-{monitoring:test.item.last(0)}&gt;100
  </code></pre>