Ad Widget

Collapse

Problem API - Only return current issues where item has not been disabled

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SiteNotFound
    Junior Member
    • Jun 2021
    • 2

    #1

    Problem API - Only return current issues where item has not been disabled

    Hello there!

    I am attempting to make use of the Zabbix API to retrieve ALL current problems, on hosts & items that are enabled.

    I've been able to accomplish part of this, i can get all current problems, however i also get problems from disabled hosts, items & triggers coming back in the response as well.

    Having tried for a few days, i'm now at a bit of a loss. I've attempted this on 4.0 LTS, 5.0 LTS and 5.2 all of which have the same behaviour.

    We have disabled items & triggers on some hosts - such as switches - as there are certain ports which we expect to go up/down for example, and as such do not need to be notified of these events.

    Similarly, some hosts are disabled as they are either old machines or not currently in use (I could use maintenance for the latter, though that's out with the scope of this query)

    So, in summary, can i please get some guidance to return only current problems, on enabled hosts, items & triggers?

    Thanks in advance


    Here's a very brief example of the issue i'm facing, using the following API call, i get events that are indeed problems, however i also get events that are linked to disabled triggers & items.

    Code:
    curl -s -X POST -H 'Content-Type: application/json-rpc' -d " \
    {
    \"jsonrpc\": \"2.0\",
    \"method\": \"problem.get\",
    \"params\": {
    \"output\": \"extend\",
    \"selectAcknowledges\": \"extend\",
    \"selectTags\": \"extend\",
    \"selectSuppressionData\": \"extend\",
    \"severities\": \"4\",
    \"acknowledged\": \"0\",
    \"recent\": \"0\",
    \"suppressed\": \"0\"
    },
    \"auth\": \"$auth\",
    \"id\": 1
    }
        
    " $url | jq .
    Click image for larger version

Name:	Screenshot 2021-06-06 124810.png
Views:	1078
Size:	65.7 KB
ID:	426090
  • VectorAudioUK
    Junior Member
    • Oct 2020
    • 7

    #2
    It's not you. I'm getting the same here. Items that are disabled, but would otherwise be in alarm are showing when I run a problems.get.

    Comment

    • syco
      Junior Member
      • Jul 2018
      • 6

      #3
      Hi, is there any solution for this? Maybe with a filter?

      Comment


      • prandre
        prandre commented
        Editing a comment
        Add a parameter: "monitored": 1

        This forces it to return only enabled items
    Working...