Ad Widget

Collapse

API - history.get não retorna o valor histórico do item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brenoacp
    Junior Member
    • Jun 2016
    • 26

    #1

    API - history.get não retorna o valor histórico do item

    Salve salve!
    Pessoal preciso pesquisar o histórico de um item para gerar alguns gráficos em um relatório automatizado.
    Porém a consulta da API não me retorna nenhum valor. Vou dar um exemplo:
    Segue a consulta abaixo usando host.get
    consulta:
    {
    "output":["host"],
    "sortfield": "name",
    "hostids": "10129",
    "selectItems":["itemid","name","key_"]
    }

    resultado:
    {
    "hostid": "10129",
    "host": "SRVAD01",
    "items": [
    {
    "itemid": "24687",
    "name": "Host name of zabbix_agentd running",
    "key_": "agent.hostname"
    }

    Até aqui tudo bem, mais quando realizo a consulta com metodo history.get utilizando por exemplo o "itemid": "24687" o resultado é nulo:

    {
    "output": "extend",
    "history": 0,
    "itemids": "24687",
    "sortfield": "clock",
    "sortorder": "DESC",
    "limit": 10
    }


    Resultado:
    {
    "jsonrpc": "2.0",
    "result": [],
    "id": 25
    }

    O que eu estaria fazendo de errado?

    Grato,
    Breno Padovan
  • alisson
    Member
    Zabbix Certified Specialist
    • Nov 2009
    • 70

    #2
    Tu chegou a ver se o history do item é do tipo 0 mesmo? 0 é float.

    De acordo com a documentação:
    Code:
    Possible values: 
    0 - numeric float; 
    1 - character; 
    2 - log; 
    3 - numeric unsigned; 
    4 - text.
    __________________
    --
    Alisson Oliveira
    [url]www.zabbix.com.br[/url]
    [url]www.unirede.net[/url]
    Porto Alegre - RS - Brasil

    Comment

    • Kimat12disa
      Junior Member
      • Jan 2017
      • 1

      #3
      Api

      API work or not ?

      Comment

      • brenoacp
        Junior Member
        • Jun 2016
        • 26

        #4
        Originally posted by Kimat12disa
        API work or not ?
        Sorry for the delay in returning.
        Yes, it works, I was using the wrong history parameter.

        Best regards.

        Comment

        Working...