Ad Widget

Collapse

Zabbix API history.get EMPTY

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lcb.lucas
    Junior Member
    • Dec 2019
    • 7

    #1

    Zabbix API history.get EMPTY

    Hi all,

    I'm trying to run API history.get but all outputs is empty. I already try with and without parameters, change parameters, but the output is always empty.

    As the first step, I'm running a "item.get" to get item id:

    payload = {
    "jsonrpc": "2.0",
    "method": "item.get",
    "params": {
    "output": "extend",
    "filter": {
    "hostids": [
    i
    ]
    },
    "search": {
    "key_": "agent.ping"
    },
    },
    "auth": self.chave,
    "id": 1

    After this, I'm running the history.get with the output item id of first step:

    payload = {
    "jsonrpc": "2.0",
    "method": "history.get",
    "params": {
    "output": ["itemid"],
    "history": 0,
    "itemids": ["10020"],
    "hostids": "10612",
    #"time_from": "1632713380",
    #"time_till": "1632716980",
    "sortfield": "clock",
    "sortorder": "DESC",
    #"limit": 10
    },
    "auth": self.chave,
    "id": 1
    }

    Result is empty:

    {'jsonrpc': '2.0', 'result': [], 'id': 1}

    Does anybody can help me, please?

    Thanks and regards!
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Try calling the API with 3 as the value of history.

    Comment

    • lcb.lucas
      Junior Member
      • Dec 2019
      • 7

      #3
      Thanks Atsushi! All it's working now!

      Comment

      Working...