See www.zabbix.com for the official Zabbix site.

Docs/specs/ZBXNEXT-1193

From Zabbix.org
Jump to: navigation, search

Zabbix API for trend.get method

ZBXNEXT-1193

Status: v1.0

Owner: Ivo

Summary

Zabbix API should support trend.get method.

Specification

Front-end changes

No frontend changes.

API changes

New API method trend.get will be introduced.

Description

integer/array trend.get(object parameters)

The method allows to retrieve trends according to the given parameters.

Parameters

(object) Parameters defining the desired output.

Parameter Type Description
itemids string/array Return only trends with the given item IDs.
time_from timestamp Return only values that have been collected after or at the given time.
time_till timestamp Return only values that have been collected before or at the given time.
countOutput flag Count the number of retrieved objects.
limit integer Limit the amount of retrieved objects
output query Set fields to output.

Return values

  • (integer/array) Returns either:
    • an array of objects;
    • the count of retrieved objects, if the countOutput parameter has been used.

Validation

No validation required.

Example

Return last value for given item.

Request:

{
    "output": [
        "itemid",
        "clock",
        "num",
        "value_min",
        "value_avg",
        "value_max",
    ],
    "itemids": [
        "23715"
    ],
    "limit": "1"
}

Output:

[
    {
        "itemid": "23715",
        "clock": "1446199200",
        "num": "60",
        "value_min": "0.1650",
        "value_avg": "0.2168",
        "value_max": "0.3500",
    }
]

Translation strings

  • No translation string changes.

Database changes

No database changes.

Also discussed

  • Common get method fields: "editable", "filter", "search", "excludeSearch", "searchByAny", "searchWildcardsEnabled", "startSearch " are not required for this API method.
  • Parameter "trends" (to get values only from tables trends - ITEM_VALUE_TYPE_FLOAT or trends_uint - ITEM_VALUE_TYPE_UINT64) will not be introduced. Tables determined by items and will be joined to create a query.
  • Parameter "hostids" will not be introduced. "itemids" should be sufficient enough.
  • Parameter "itemids" does not require validation.
  • No new table indexes and no sorting parameters will be added for now.

Documentation

ChangeLog

N/A