FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)

1 Aggregate functions

All functions listed here are supported in:

Aggregate functions can work with either:

  • history of items, for example, min(/host/key,1h)
  • foreach functions as the only parameter, for example, min(last_foreach(/*/key))

Some general notes on function parameters:

  • Function parameters are separated by a comma
  • Optional function parameters (or parameter parts) are indicated by < >
  • /host/key is a common mandatory first parameter for the functions referencing the host item history
  • /host/key and time period:time shift parameters must never be quoted
  • Function-specific parameters are described with each function

Aggregate functions

FUNCTION
Description Function-specific parameters Comments
avg (/host/key,time period<:time shift>)
Average value of an item within the defined evaluation period. time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Examples:
=> avg(/host/key,1h) → average value1 for an hour
=> avg(/host/key,1h:now-1d) → average value for an hour one day ago
=> avg(/host/key,#5) → average value of the five latest values

Time shift is useful when there is a need to compare the current average value with the average value some time ago.
kurtosis (/host/key,time period<:time shift>)
"Tailedness" of the probability distribution in collected values within the defined evaluation period.

See also: Kurtosis
time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> kurtosis(/host/key,1h) → kurtosis1 for an hour
mad (/host/key,time period<:time shift>)
Median absolute deviation in collected values within the defined evaluation period.

See also: Median absolute deviation
time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> mad(/host/key,1h) → median absolute deviation1 for an hour
max (/host/key,time period<:time shift>)
Highest value of an item within the defined evaluation period. time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> max(/host/key,1h) - min(/host/key,1h) → calculate the difference between the maximum and minimum values within the last hour1 (delta of values)
min (/host/key,time period<:time shift>)
Lowest value of an item within the defined evaluation period. time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> max(/host/key,1h) - min(/host/key,1h) → calculate the difference between the maximum and minimum values within the last hour1 (delta of values)
skewness (/host/key,time period<:time shift>)
Asymmetry of the probability distribution in collected values within the defined evaluation period.

See also: Skewness
time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> skewness(/host/key,1h) → skewness1 for an hour
stddevpop (/host/key,time period<:time shift>)
Population standard deviation in collected values within the defined evaluation period.

See also: Standard deviation
time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> stddevpop(/host/key,1h) → population standard deviation1 for an hour
stddevsamp (/host/key,time period<:time shift>)
Sample standard deviation in collected values within the defined evaluation period.

See also: Standard deviation
time period - maximum evaluation period in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

At least two data values are required for this function to work.

Example:
=> stddevsamp(/host/key,1h) → sample standard deviation1 for an hour
sum (/host/key,time period<:time shift>)
Sum of collected values within the defined evaluation period. time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> sum(/host/key,1h) → sum of values1 for an hour
sumofsquares (/host/key,time period<:time shift>)
The sum of squares in collected values within the defined evaluation period. time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> sumofsquares(/host/key,1h) → sum of squares1 for an hour
varpop (/host/key,time period<:time shift>)
Population variance of collected values within the defined evaluation period.

See also: Variance
time period - maximum evaluation period1 in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

Example:
=> varpop(/host/key,1h) → population variance1 for an hour
varsamp (/host/key,time period<:time shift>)
Sample variance of collected values within the defined evaluation period.

See also: Variance
time period - maximum evaluation period in seconds (time suffixes can be used) or in latest collected values (if preceded by a hash mark)

Time shift (optional) allows to move the evaluation point back in time.
Supported value types: float, int

At least two data values are required for this function to work.

Example:
=> varsamp(/host/key,1h) → sample variance1 for an hour
Footnotes

1 The function is evaluated starting with the first received value (unless the time shift parameter is used), i.e. Zabbix will not wait for all the values of the defined evaluation period before evaluating the function.