Esta é uma tradução da página de documentação original em inglês. Ajude-nos a torná-la melhor.

> Task object

The following objects are directly related to the task API.

<note note>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:

Property Type Description
taskid string (readonly) ID of the task.
type
(required)
integer Type of the task.

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

Possible values:
1 - new task;
2 - task in progress;
3 - task is completed;
4 - task is expired.
clock timestamp (readonly) Time when the task was created.
ttl integer (readonly) The time in seconds after which task expires.
proxy_hostid string ID of the proxy about which diagnostic information statistic is collected.
Ignored for 'Check now' tasks.
request
(required)
object Task 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.
result object (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.

Property Type Description
itemid string ID 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.

Property Type Description
historycache object History cache statistic request. Available on server and proxy.
valuecache object Items cache statistic request. Available on server.
preprocessing object Preprocessing manager statistic request. Available on server and proxy.
alerting object Alert manager statistic request. Available on server.
lld object LLD 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.

Property Type Description
stats query Statistic 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.
top object Object 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 type Available fields Description
historycache items Number of cached items.
values Number of cached values.
memory Shared memory statistics (free space, number of used chunks, number of free chunks, max size of free chunk).
memory.data History data cache shared memory statistics.
memory.index History index cache shared memory statistics.
valuecache items Number of cached items.
values Number of cached values.
memory Shared memory statistics (free space, number of used chunks, number of free chunks, max size of free chunk).
mode Value cache mode.
preprocessing values Number of queued values.
preproc.values Number of queued values with preprocessing steps.
alerting alerts Number of queued alerts.
lld rules Number of queued rules.
values Number 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 type Available fields Type
historycache values integer
valuecache values integer
request.values integer
preprocessing values integer
alerting media.alerts integer
source.alerts integer
lld values integer

Statistic result object

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

Property Type Description
status integer (readonly) Status of the task result.

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