Ad Widget

Collapse

Zabbix API: how to make an INTERSECTION instead of an UNION?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • r-br
    Junior Member
    • Feb 2011
    • 27

    #1

    Zabbix API: how to make an INTERSECTION instead of an UNION?

    Hi everyone,

    I'm using v1.8.3. I'm trying to retrieve the items of some hosts. So far that's what I found, for example, for this request:

    Code:
    item.get
    hostids: 2001,2002,2003  <- the host IDs I want to filter by
    output: extend
    The response brings me an array of items, and that's fine.

    However, the problem is that the internal query is making an UNION of the items for each host, not an INTERSECTION; it's something like:

    Code:
    WHERE hostid = 2001 OR hostid = 2002 OR hostid = 2003
    Instead of:

    Code:
    WHERE hostid = 2001 AND hostid = 2002 AND hostid = 2003
    When I say "intersection", I mean items with the same key. I want the request to return only the items in common to each host, considering the key_ value.

    My question: is there any way to make this intersection, instead of the union, through the API?

    Thanks.
    Last edited by r-br; 07-02-2011, 20:36. Reason: Better explaining.
Working...