Zabbix Documentation 2.0

3.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.22.43.23.4

User Tools

Site Tools


Sidebar

manual:appendix:api:application:get

application.get

Description

integer/array application.get(object parameters)

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

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
applicationids string/array Return only applications with the given IDs.
groupids string/array Return only applications that belong to hosts from the given host groups.
hostids string/array Return only applications that belong to the given hosts.
inherited boolean If set to true return only applications inherited from a template.
itemids string/array Return only applications that contain the given items.
templated boolean If set to true return only applications that belong to templates.
templateids string/array Return only applications that belong to the given templates.
expandData flag Return the name of the host that the application belongs to as a property of the application object.
selectHosts query Return the hosts that the application belongs to in the hosts property.

Does not support shorten.
selectItems query Return the items contained in the application in the items property.

Does not support shorten or arrays of values.
sortfield string/array Sort the result by the given properties.

Possible values are: applicationid and name.
countOutput flagThese parameters being common for all get methods are described in detail on the Generic Zabbix API information page.
editable boolean
excludeSearch flag
filter object
limit integer
nodeids string/array
output query
preservekeys flag
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch flag

Return values

(integer/array) Returns either:

  • an array of objects;
  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving applications from a host

Retrieve all applications from a host sorted by name.

Request:

{
    "jsonrpc": "2.0",
    "method": "application.get",
    "params": {
        "output": "extend",
        "hostids": "10001",
        "sortfield": "name"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}

Response:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "applicationid": "13",
            "hostid": "10001",
            "name": "CPU",
            "templateid": "0"
        },
        {
            "applicationid": "5",
            "hostid": "10001",
            "name": "Filesystems",
            "templateid": "0"
        },
        {
            "applicationid": "21",
            "hostid": "10001",
            "name": "General",
            "templateid": "0"
        },
        {
            "applicationid": "15",
            "hostid": "10001",
            "name": "Memory",
            "templateid": "0"
        },
    ],
    "id": 1
}

See also

Source

CApplication::get() in frontends/php/api/classes/CApplication.php.