Ad Widget

Collapse

Retrieve Active Trigger Problem, via API on 3.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcolino7
    Junior Member
    • Mar 2017
    • 11

    #1

    Retrieve Active Trigger Problem, via API on 3.2

    Hi,
    I'm struggling with API. I need to retrieve via API, the same list of Problem's Tab in the Dashboard.

    Click image for larger version

Name:	2018-10-25 12_30_03-Zabbix docker_ Dashboard.png
Views:	509
Size:	165.4 KB
ID:	367905

    I setup Dashboard Problem's TAB to show me only lasr 25 Recent problem.
    Click image for larger version

Name:	2018-10-25 12_39_15-Zabbix docker_ Dashboard.png
Views:	475
Size:	145.5 KB
ID:	367906

    I tried with trigger.get method with this filter:

    Code:
    {
        "jsonrpc": "2.0",
        "method": "trigger.get",
        "params": {
            "output": "extend",
                    "selectTriggers": "extend",
                    "expandDescription": 1,
                    "filter": {
                        "value": 1,
                        "status": 0
                    },
                    "sortfield": "priority",
                    "sortorder": "DESC"
        },
        "id": 2,
        "auth": "{{token}}"
    }
    But this request return me also trigger on Disable Host that are not shown in Problem's TAB on Dashboard.

    I need some help or suggestion on how filter trigger.get in order to achieve this request.
    Many Thanks in advance.

    Marco


  • ali.inal
    Junior Member
    • Apr 2021
    • 2

    #2
    I know very old post. But for whom searching solution for the same question;

    Code:
    {
        "jsonrpc": "2.0",
        "method": "trigger.get",
        "params": {
            "output": "extend",
                    "selectTriggers": "extend",
                    "expandDescription": 1,
                    "monitored": 1,
                    "active": 1,
                    "filter": {
                        "value": 1,
                        "status": 0
                    },
                    "sortfield": "priority",
                    "sortorder": "DESC"
        },
        "auth": "{{token}}",
        "id": 1
    }
    Add monitored and active flags as above...

    Cheers,
    Ali

    Comment

    Working...