Ad Widget

Collapse

API limit result when history.get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmgonzalez.velneo
    Junior Member
    • Mar 2023
    • 2

    #1

    API limit result when history.get

    Hi

    When we use the zabbix api to query the history of an item, it does not return all the data, although in zabbix we see all the data of the requested date range. Any idea?
    The query is (The date range corresponds to the first days of February 2023.)
    Code:
    curl -s -X POST \
    -H 'Content-Type: application/json-rpc' \
    -d " \
    
    {
    \"jsonrpc\": \"2.0\",
    \"method\": \"history.get\",
    \"params\": {
    \"output\": \"extend\",
    \"itemids\": \"648868\",
    \"time_from\": \"1675295940\",
    \"time_till\": \"1676073540\",
    \"sortfield\": \"clock\",
    \"sortorder\": \"ASC\",
    \"limit\": 100000
    },
    \"auth\": \"$auth\",
    \"id\": 1
    }
    
    " $url​
    And the result is
    Code:
    {"jsonrpc":"2.0","result":[],"id":1}
    Although itemid 648868 is configured with a 90 day history


    Any idea?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    I may be wrong here, but maybe you should specify also object type to be returned.. It defaults to numeric(unsigned) and if that does not match your item config, then you won't get results...

    Comment

    • jmgonzalez.velneo
      Junior Member
      • Mar 2023
      • 2

      #3
      It does match with numeric (unsigned), in fact I forgot to comment that for another date range closer to today it does return the data correctly.

      Thanks

      Comment

      Working...