asp.netzabbix

Problem fetching history of CPU with Zabbix API


I'm newbie with Zabbix.

Firstly, i'm getting the itemIDs of key"system.cpu.[,user]" and ""system.cpu.load[percpu,avg1]". Now, i'm interessed to fetch history data of these itemIDs (key"system.cpu.[,user]","system.cpu.load[percpu,avg1]") to fetch previous CPU utilization of VM's. However, when make http.get(history.get) with the next parameters:

"method": "history.get",
"params": {
    "output": "extend",
    "history": 0,
    "itemids": "28887", --> itemID of system.cpu.[,user]
    "sortfield": "clock",
    "sortorder": "DESC",
    "limit": 10
}

The response is always 0 results. But with anothers itemsIds, the response fetch many results.

Someone can help me what is going wrong please? PS: I'm using zabbix .NET SDK API, but i tryed with other packages the response was the same.


Solution

  • Pay particular attention to the type of data you request: the history parameter possible values are:

    See: history/get