Ad Widget

Collapse

Having two items with value xy and trigger which tests if they are the same

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • riBoon
    Junior Member
    • May 2017
    • 27

    #1

    Having two items with value xy and trigger which tests if they are the same

    Hi,
    I have a race condition in my trigger.
    I have two items checking at defined schedule time getting a value which is the correct value for today. But we have to make sure they are the same.

    So my trigger expression looks like:
    last(item1)<>last(item2)

    And what I get is a problem alert with duration 0s as the first item creates the problem (values differ), the second switches it to ok.

    Is there an easy way to get this done?
  • guntis_liepins
    Member
    • Oct 2025
    • 52

    #2
    What are these items ? What is their type? How do you get them from server?

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4862

      #3
      I think you need a calculated item there... if you compare those values directly, as you have in exampe, it gets recalculated each time new value arrives for any of items...And that causes you those 0 lenght events... If you add 3rd item here, which by schedule compares those 2 values, it shoudl be more accurate. You can also configure a scheduler for items themselves (lets say exact 00 seconds of every minute) and calculated item in every 30th second every minute...

      Comment

      • riBoon
        Junior Member
        • May 2017
        • 27

        #4
        Ok, wow. That's really a good idea. I thought to much in trigger those items directly but a calculated item is the answer for my problem, of course.
        @guntis_liepins sorry for missing informations. I extract numbers of strings (with pre processing regex) and the number is the current date. So I compare two date numbers here like 260318 (26 is the year 2026)

        So my actual calculated item looks like: last(//item_key1)/last(//item_key2) and if I get 1 it's ok. I didn't find a compare function for calculated items.
        Last edited by riBoon; Today, 17:08.

        Comment

        Working...