Ad Widget

Collapse

Combine nodata() and value() of one item in a trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pgulchuk
    Junior Member
    • May 2013
    • 3

    #1

    Combine nodata() and value() of one item in a trigger

    Hi.

    I want to create trigger with expression like this:

    {some.item.nodata(300)}=1 | {some.item.min(300)}>0

    I have script which send retcode as zabbix trap. And it will be good to have trigger that alerts if there were no successful results during last 5 minutes.
    Expression above becomes undefined if no data available last 5 min (script did not executed), and trigger falls to unknown state, no alarm reporting.
    If I create two triggers, one with nodata() and one with min(), then both of them will generate events if script returns non-zero retcode after some time when it was not executed, it's not what I want.

    Can zabbix process logical "or" like most of programming languages, i.e. do not execute second part of logical disjunction if first part is true?

    Any suggestions?
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    I think all trigger functions get evaluated first and then logically interconnected.
    I believe the problem is {some.item.min(300)} which may result in 'no data', what is not arithmetic evaluable.

    Maybe this is a sufficient alternative to you:
    {some.item.nodata(300)}=1 | {some.item.count(5m,0,gt)}#0

    Comment

    • pgulchuk
      Junior Member
      • May 2013
      • 3

      #3
      Thank you!
      I miss optional conditioning parameters for count() function.
      It's enough to use "{some.item.count(5m,0,eq)}#0" in my case.

      However process logical operations as conditional operators in trigger expressions can be interesing not only for this usecase. Result of "true or undefined" should be "true" but not "undefined". Result of "false and undefined" is "false".
      Such logic should save resources, it's not needed to make db requests for processing all expressions in trigger "expr1 | expr2 | expr3 | expr4" if first expression is true.

      Comment

      Working...