[comment]: # ({b41635a8-b41635a8})
# 12 Aggregate checks

[comment]: # ({/b41635a8-b41635a8})

[comment]: # ({7d86de47-7d86de47})
#### Overview

In aggregate checks Zabbix server collects aggregate information from
items by doing direct database queries.

Aggregate checks do not require any agent running on the host being
monitored.

[comment]: # ({/7d86de47-7d86de47})

[comment]: # ({7d28d0b3-1642077e})
#### Syntax

The syntax of the aggregate item key is:

    groupfunc["host group","item key",itemfunc,timeperiod]

Supported group functions (groupfunc) are:

|Group function|Description|
|--------------|-----------|
|*grpavg*|Average value|
|*grpmax*|Maximum value|
|*grpmin*|Minimum value|
|*grpsum*|Sum of values|

Multiple host groups may be included by inserting a comma-delimited
array. Specifying a parent host group will include the parent group and
all nested host groups with their items.

All items that are referenced from the aggregate item key must exist and
be collecting data. Only enabled items on enabled hosts are included in
the calculations.

::: noteimportant
The key of the aggregate item must be updated
manually, if the item key of a referenced item is changed.
:::

Supported item functions (itemfunc) are:

|Item function|Description|
|-------------|-----------|
|*avg*|Average value|
|*count*|Number of values|
|*last*|Last value|
|*max*|Maximum value|
|*min*|Minimum value|
|*sum*|Sum of values|

The **timeperiod** parameter specifies a time period of latest collected
values. [Supported unit symbols](/fr/manual/appendix/suffixes) can be
used in this parameter for convenience, for example '5m' (minutes)
instead of '300' (seconds) or '1d' (day) instead of '86400' (seconds).

::: notewarning
An amount of values (prefixed with **\#**) is not
supported in the timeperiod.
:::

Timeperiod is ignored by the server if the third parameter (item
function) is *last* and can thus be omitted:

    groupfunc["host group","item key",last]

::: noteclassic
If the aggregate results in a float value it will be trimmed
to an integer if the aggregated item type of information is *Numeric
(unsigned)*.
:::

An aggregate item may become unsupported if:

-   none of the referenced items is found (which may happen if the item
    key is incorrect, none of the items exists or all included groups
    are incorrect)
-   no data to calculate a function

[comment]: # ({/7d28d0b3-1642077e})

[comment]: # ({a22bee19-a22bee19})
#### Usage examples

Examples of keys for aggregate checks:

[comment]: # ({/a22bee19-a22bee19})

[comment]: # ({cddf98e9-cddf98e9})
##### Example 1

Total disk space of host group 'MySQL Servers'.

    grpsum["MySQL Servers","vfs.fs.size[/,total]",last]

[comment]: # ({/cddf98e9-cddf98e9})

[comment]: # ({b518f8b1-b518f8b1})
##### Example 2

Average processor load of host group 'MySQL Servers'.

    grpavg["MySQL Servers","system.cpu.load[,avg1]",last]

[comment]: # ({/b518f8b1-b518f8b1})

[comment]: # ({3d33350c-3d33350c})
##### Example 3

5-minute average of the number of queries per second for host group
'MySQL Servers'.

    grpavg["MySQL Servers",mysql.qps,avg,5m]

[comment]: # ({/3d33350c-3d33350c})

[comment]: # ({8109f38a-8109f38a})
##### Example 4

Average CPU load on all hosts in multiple host groups.

    grpavg[["Servers A","Servers B","Servers C"],system.cpu.load,last]

[comment]: # ({/8109f38a-8109f38a})
