Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

Zabbix 5.0 API method problem.get: how to get a list of unacknowledged problems?

Please help me to solve this problem: I need to get a list of all unacknowledged problems from Zabbix 5.0.4 via API.

When I make a request like this

{
    "jsonrpc": "2.0",
    "method": "problem.get",
    "params": {
        "severities": ["4", "5"],
        "acknowledged": "0",
        "suppressed": "0",
        "countOutput": "true"
    },
    "auth": "auth_token",
    "id": 1
}

I get in response

{
    "jsonrpc": "2.0",
    "result": "424",
    "id": 1
}

but when I go to the page with a list of problems in the browser, for example, at

https://localhost/zabbix.php?action=problem.view&filter_show=3&filter_application=&filter_name=&filter_severities%5B4%5D=4&filter_severities%5B5%5D=5&filter_inventory%5B0%5D%5Bfield%5D=type&filter_inventory%5B0%5D%5Bvalue%5D=&filter_evaltype=0&filter_tags%5B0%5D%5Btag%5D=&filter_tags%5B0%5D%5Boperator%5D=0&filter_tags%5B0%5D%5Bvalue%5D=&filter_show_tags=3&filter_tag_name_format=0&filter_tag_priority=&filter_show_opdata=0&filter_unacknowledged=1&filter_set=1

I get only 10 problems in response, instead of 400+ in response from API. Why is that? What am I doing wrong? Tell me please.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...