> Task object

The following objects are directly related to the task API.

Task object described in this page is supported since Zabbix version 5.0.5. For proper usage of task.create in older Zabbix versions, please see documentation for task.create.

The task object has the following properties:

PropertyTypeDescription
taskidstring(readonly) ID of the task.
type
(required)
integerType of the task.

Possible values:
1 - Diagnostic information;
6 - Check now.
statusinteger(readonly) Status of the task.

Possible values:
1 - new task;
2 - task in progress;
3 - task is completed;
4 - task is expired.
clocktimestamp(readonly) Time when the task was created.
ttlinteger(readonly) The time in seconds after which task expires.
proxy_hostidstringID of the proxy about which diagnostic information statistic is collected.
Ignored for ‘Check now’ tasks.
request
(required)
objectTask request object according to the task type:
Object of ‘Check now’ task is described in detail below;
Object of ‘Diagnostic information’ task is described in detail below.
resultobject(readonly) Result object of the diagnostic information task. May contain NULL if result is not yet ready. Result object is described in detail below.

‘Check now’ request object

The ‘Check now’ task request object has the following properties.

PropertyTypeDescription
itemidstringID of item and low-level discovery rules.

‘Diagnostic information’ request object

The diagnostic information task request object has the following properties. Statistic request object for all types of properties is described in detail below.

PropertyTypeDescription
historycacheobjectHistory cache statistic request. Available on server and proxy.
valuecacheobjectItems cache statistic request. Available on server.
preprocessingobjectPreprocessing manager statistic request. Available on server and proxy.
alertingobjectAlert manager statistic request. Available on server.
lldobjectLLD manager statistic request. Available on server.

Statistic request object

Statistic request object is used to define what type of information should be collected about server/proxy internal processes. It has the following properties.

PropertyTypeDescription
statsqueryStatistic object properties to be returned. The list of available fields for each type of diagnostic information statistic are described in detail below.

Default: extend will return all available statistic fields.
topobjectObject to sort and limit returned statistic values. The list of available fields for each type of diagnostic information statistic are described in detail below.

Example:
{ “source.alerts”: 10 }
List of statistic fields available for each type of diagnostic information request

Following statistic fields can be requested for each type of diagnostic information request property.

Diagnostic typeAvailable fieldsDescription
historycacheitemsNumber of cached items.
valuesNumber of cached values.
memoryShared memory statistics (free space, number of used chunks, number of free chunks, max size of free chunk).
memory.dataHistory data cache shared memory statistics.
memory.indexHistory index cache shared memory statistics.
valuecacheitemsNumber of cached items.
valuesNumber of cached values.
memoryShared memory statistics (free space, number of used chunks, number of free chunks, max size of free chunk).
modeValue cache mode.
preprocessingvaluesNumber of queued values.
preproc.valuesNumber of queued values with preprocessing steps.
alertingalertsNumber of queued alerts.
lldrulesNumber of queued rules.
valuesNumber of queued values.
List of sorting fields available for each type of diagnostic information request

Following statistic fields can be used to sort and limit requested information.

Diagnostic typeAvailable fieldsType
historycachevaluesinteger
valuecachevaluesinteger
request.valuesinteger
preprocessingvaluesinteger
alertingmedia.alertsinteger
source.alertsinteger
lldvaluesinteger

Statistic result object

Statistic result object is retrieved in result field of task object.

PropertyTypeDescription
statusinteger(readonly) Status of the task result.

Possible values:
-1 - error occurred during performing task;
0 - task result is created.
datastring/objectResults according the statistic request object of particular diagnostic information task. Contains error message string if error occurred during performing task.