Search code examples
jsonapizabbixmonit

how to get zabbix last 20 issue in zabbixAPI?


Picture as below: last 20 issues

I want to build a software to combine the hosts alert from the same group,i used to develop some batch processing function in PHP to call the zabbix API.So i want to implement that way.

zabbix 3.0 api . It seems what i looking for,but on zabbix 2.x,how to get the last 20 issues,it does not have the method "problem.get".


Solution

  • You linked to the 3.2 documentation, which refactored the event an trigger screens into a problem screen (with the necessary API changes).

    You want to use the trigger.get method:

    {
        ...
        "method": "trigger.get",
        "params": {
            "filter": {"value": "1"},
            "sortfield": "lastchange"
            "limit": 20
        }
    }
    

    This is the basic, you would need to select the proper fields and select* properties to get the rest of the data.