[ZBX-22849] Not possible to get open events using the event.get API Created: 2023 May 24  Updated: 2024 May 08

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 6.4.2
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Yurii Polenok Assignee: Aigars Kadikis
Resolution: Unresolved Votes: 2
Labels: api, event.get
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Steps to reproduce:

{
    "jsonrpc": "2.0",
    "method": "event.get",
    "params": {
        "output": [
            "eventid",
            "value",
            "r_eventid"
        ],
        "value": "1",
        "search": {
            "r_eventid": "0"
        },
        "startSearch": true,
        "limit": 5
    },
    "id": 1
}

Result:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "eventid": "3761654",
            "value": "1",
            "r_eventid": "0"
        },
        {
            "eventid": "4083768",
            "value": "1",
            "r_eventid": "0"
        },
        {
            "eventid": "5171834",
            "value": "1",
            "r_eventid": "5171926"
        },
        {
            "eventid": "5171837",
            "value": "1",
            "r_eventid": "5171840"
        },
        {
            "eventid": "5171839",
            "value": "1",
            "r_eventid": "5171844"
        }
    ],
    "id": 1
}

Expected:
Only active/open/problem/not resolved events, with r_eventid = 0, meaning the event is still not resolved.

If I have missed some parameter to filter such events, please advise how to do it.



 Comments   
Comment by Aigars Kadikis [ 2023 May 25 ]

To get open(active) events, have a look at the API method problem.get:
https://www.zabbix.com/documentation/current/en/manual/api/reference/problem/get

The ZBX project is for bug reports only. Currently, your use case does not look like a bug.

To get free support please use: https://www.zabbix.com/forum/ or contact Zabbix professional services.

Comment by Yurii Polenok [ 2023 May 25 ]

Thanks aigars.kadikis!
problem.get solves our problem. It would be great if it only showed problems that are visible on the web, but now it can also return problems that are related to disabled hosts, items, triggers, and other objects. Same behaviour for event.get and problem.get.

Comment by Thiago [ 2024 May 08 ]

I Think this is a bug, search ou filter by r_eventid = 0 and result not like expected.

Generated at Fri Apr 18 05:01:30 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.