Ad Widget

Collapse

zabbix api evaltype and several tags to search

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mseemann
    Junior Member
    • Aug 2022
    • 3

    #1

    zabbix api evaltype and several tags to search

    i wanted to search items and triggers with item.get and trigger.get.
    Filter must be two tags with values, both must match.
    evaltype 0 says is And/Or (which makes no sense to me, can someone explain? And or Or would be Or )
    evaltype 2 says Or
    what i would need is: give me all items where tag1 value matches 'ab' AND tag2 value matches 'xy'
    Can anybody clarify how this is meant to work, or to be used, or to be done
  • Answer selected by mseemann at 03-02-2023, 10:45.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4929

    It is the same as in GUI, if you look for example Monitoring-> Hosts. There is also Tags and option to choose between And/Or and OR
    But luckily, we have explanations for frontend sections https://www.zabbix.com/documentation...nitoring/hosts
    And/Or - all conditions must be met, conditions having the same tag name will be grouped by the Or condition
    Or - enough if one condition is met

    Comment

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

      #2
      It is the same as in GUI, if you look for example Monitoring-> Hosts. There is also Tags and option to choose between And/Or and OR
      But luckily, we have explanations for frontend sections https://www.zabbix.com/documentation...nitoring/hosts
      And/Or - all conditions must be met, conditions having the same tag name will be grouped by the Or condition
      Or - enough if one condition is met

      Comment

      • mseemann
        Junior Member
        • Aug 2022
        • 3

        #3
        Hi cyber,

        Understand the meaning now, works now fine as i wanted.
        If someone comes up having the same question, my problem arose using the wron json code. wanted to have all items with x=10 and y=a1.
        I put both conditions into one tag evaluation, which leads to the result that the latter values are taken only.

        wrong code:
        "tags": [{"tag": "x", "value": "10", "operator": "1", "tag": "Stage", "value": "a1", "operator": "1"}],
        right code:
        "tags": [{"tag": "x", "value": "10", "operator": "1"}, {"tag": "Stage", "value": "a1", "operator": "1"}],

        Thank you very much, much appreciated

        Comment

        Working...