Ad Widget

Collapse

Get the same problems listed in "Problems" with API.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anony777
    Junior Member
    • Feb 2022
    • 2

    #1

    Get the same problems listed in "Problems" with API.

    Hello,

    Im looking for the problems list (problem.get) but only the probems also listed on the dashboard itself. I've tried it with triggers etc etc, I can not filter for status anywhere. When I do problem.get I get 712 problems while there are only like 10 active now. I would like the same list as in the dashboard itself
  • splitek
    Senior Member
    • Dec 2018
    • 101

    #2
    Probably your dashboard have some filters.
    Also maybe you need to use in problem.get "params" parameter > "recent": "false"

    Comment

    • Anony777
      Junior Member
      • Feb 2022
      • 2

      #3
      Its the standard 'recent problems' dashboard. The problems.get returns all problems and you can not filter on certain things like status etc. I am looking in the event.get but even there I can see status and value but those options do not show the same problem list as in my dashboard. It looks like dashboard problems uses some filter in the background, but I can not find out what it is.

      Comment

      • splitek
        Senior Member
        • Dec 2018
        • 101

        #4
        problem.get - by default return "unresolved problems" this means "open problems"
        You can filter on all parameters that are returned by this method using "filter" or "search"
        As you probably know all parameters are here: https://www.zabbix.com/documentation...ce/problem/get
        Also there is some note (maybe it apply to you): " This method may return problems of a deleted entity if these problems have not been removed by the housekeeper yet."

        Comment

        • ddrucker
          Member
          • Feb 2019
          • 35

          #5
          I'm also still trying to get this to work. I have:

          Code:
          {
              "jsonrpc": "2.0",
              "method": "problem.get",
              "params": {
                  "output": "extend",
                  "recent": false,
                  "sortfield": ["eventid"],
                  "sortorder": "DESC"
              },
              "auth": "my_api_key",
              "id": 1
          }'
          But it still returns many hundreds of entries, even though I only actually have 2 active problems right now. In fact, recent has no effect - changing it between false and true has absolutely no effect on the output.

          Comment

          Working...