All functions listed here are supported in:
The functions are listed without additional information. Click on the function to see the full details.
Function | Description |
---|---|
change | The amount of difference between the previous and latest value. |
changecount | The number of changes between adjacent values within the defined evaluation period. |
count | The number of values within the defined evaluation period. |
countunique | The number of unique values within the defined evaluation period. |
find | Find a value match within the defined evaluation period. |
first | The first (the oldest) value within the defined evaluation period. |
fuzzytime | Check how much the passive agent time differs from the Zabbix server/proxy time. |
last | The most recent value. |
logeventid | Check if the event ID of the last log entry matches a regular expression. |
logseverity | The log severity of the last log entry. |
logsource | Check if log source of the last log entry matches a regular expression. |
monodec | Check if there has been a monotonous decrease in values. |
monoinc | Check if there has been a monotonous increase in values. |
nodata | Check for no data received. |
percentile | The P-th percentile of a period, where P (percentage) is specified by the third parameter. |
rate | The per-second average rate of the increase in a monotonically increasing counter within the defined time period. |
/host/key
is a common mandatory first parameter for the functions referencing the host item history(sec|#num)<:time shift>
is a common second parameter for the functions referencing the host item history, where:
Some general notes on function parameters:
<
>
/host/key
and (sec|#num)<:time shift>
parameters must never be quotedThe amount of difference between the previous and latest value.
Supported value types: Float, Integer, String, Text, Log.
For strings returns: 0 - values are equal; 1 - values differ.
Parameters: see common parameters.
Comments:
+4
-2
-2.5
Examples:
The number of changes between adjacent values within the defined evaluation period.
Supported value types: Float, Integer, String, Text, Log.
Parameters:
For non-numeric value types, the mode parameter is ignored.
Examples:
changecount(/host/key,1w) #the number of value changes for the last week until now
changecount(/host/key,#10,"inc") #the number of value increases (relative to the adjacent value) among the last 10 values
changecount(/host/key,24h,"dec") #the number of value decreases (relative to the adjacent value) for the last 24 hours until now
The number of values within the defined evaluation period.
Supported value types: Float, Integer, String, Text, Log.
Parameters:
operators
:pattern
pattern
Comments:
pattern
parameter can be specified as two numbers, separated by '/': number_to_compare_with/mask. count() calculates "bitwise AND" from the value and the mask and compares the result to number_to_compare_with. If the result of "bitwise AND" is equal to number_to_compare_with, the value is counted.pattern
parameter can be an ordinary or global (starting with '@') regular expression. In case of global regular expressions case sensitivity is inherited from global regular expression settings. For the purpose of regexp matching, float values will always be represented with 4 decimal digits after '.'. Also note that for large numbers difference in decimal (stored in database) and binary (used by Zabbix server) representation may affect the 4th decimal digit.Examples:
count(/host/key,10m) #the values for the last 10 minutes until now
count(/host/key,10m,"like","error") #the number of values for the last 10 minutes until now that contain 'error'
count(/host/key,10m,,12) #the number of values for the last 10 minutes until now that equal '12'
count(/host/key,10m,"gt",12) #the number of values for the last 10 minutes until now that are over '12'
count(/host/key,#10,"gt",12) #the number of values within the last 10 values until now that are over '12'
count(/host/key,10m:now-1d,"gt",12) #the number of values between 24 hours and 10 minutes and 24 hours ago from now that were over '12'
count(/host/key,10m,"bitand","6/7") #the number of values for the last 10 minutes until now having '110' (in binary) in the 3 least significant bits
count(/host/key,10m:now-1d) #the number of values between 24 hours and 10 minutes and 24 hours ago from now
The number of unique values within the defined evaluation period.
Supported value types: Float, Integer, String, Text, Log.
Parameters:
operators
:pattern
pattern
Comments:
pattern
parameter can be specified as two numbers, separated by '/': number_to_compare_with/mask. countunique() calculates "bitwise AND" from the value and the mask and compares the result to number_to_compare_with. If the result of "bitwise AND" is equal to number_to_compare_with, the value is counted.pattern
parameter can be an ordinary or global (starting with '@') regular expression. In case of global regular expressions case sensitivity is inherited from global regular expression settings. For the purpose of regexp matching, float values will always be represented with 4 decimal digits after '.'. Also note that for large numbers difference in decimal (stored in database) and binary (used by Zabbix server) representation may affect the 4th decimal digit.Examples:
countunique(/host/key,10m) #the number of unique values for the last 10 minutes until now
countunique(/host/key,10m,"like","error") #the number of unique values for the last 10 minutes until now that contain 'error'
countunique(/host/key,10m,,12) #the number of unique values for the last 10 minutes until now that equal '12'
countunique(/host/key,10m,"gt",12) #the number of unique values for the last 10 minutes until now that are over '12'
countunique(/host/key,#10,"gt",12) #the number of unique values within the last 10 values until now that are over '12'
countunique(/host/key,10m:now-1d,"gt",12) #the number of unique values between 24 hours and 10 minutes and 24 hours ago from now that were over '12'
countunique(/host/key,10m,"bitand","6/7") #the number of unique values for the last 10 minutes until now having '110' (in binary) in the 3 least significant bits
countunique(/host/key,10m:now-1d) #the number of unique values between 24 hours and 10 minutes and 24 hours ago from now
Find a value match within the defined evaluation period.
Supported value types: Float, Integer, String, Text, Log.
Returns: 1 - found; 0 - otherwise.
Parameters:
operators
:pattern
(case-sensitive)pattern
pattern
operator
is regexp, iregexp.Comments:
pattern
parameter can be an ordinary or global (starting with '@') regular expression. In case of global regular expressions case sensitivity is inherited from the global regular expression settings.Example:
find(/host/key,10m,"like","error") #find a value that contains 'error' within the last 10 minutes until now
The first (the oldest) value within the defined evaluation period.
Supported value types: Float, Integer, String, Text, Log.
Parameters:
See also last().
Example:
Check how much the passive agent time differs from the Zabbix server/proxy time.
Supported value types: Float, Integer.
Returns: 1 - difference between the passive item value (as timestamp) and Zabbix server/proxy timestamp (the clock of value collection) is less than or equal to T seconds; 0 - otherwise.
Parameters:
Comments:
vfs.file.time[/path/file,modify]
key to check that the file did not get updates for long time;fuzzytime(/Host/system.localtime,60s)=0 or last(/Host/trap)<>0
.Example:
The most recent value.
Supported value types: Float, Integer, String, Text, Log.
Parameters:
Comments:
last(/host/key)
is always equal to last(/host/key,#1)
; last(/host/key,#3)
- the third most recent value (not three latest values);Example:
last(/host/key) #retrieve the last value
last(/host/key,#2) #retrieve the previous value
last(/host/key,#1) <> last(/host/key,#2) #the last and previous values differ
Check if the event ID of the last log entry matches a regular expression.
Supported value types: Log.
Returns: 0 - does not match; 1 - matches.
Parameters:
Log severity of the last log entry.
Supported value types: Log.
Returns: 0 - default severity; N - severity (integer, useful for Windows event logs: 1 - Information, 2 - Warning, 4 - Error, 7 - Failure Audit, 8 - Success Audit, 9 - Critical, 10 - Verbose).
Parameters:
Zabbix takes log severity from the Information field of Windows event log.
Check if log source of the last log entry matches a regular expression.
Supported value types: Log.
Returns: 0 - does not match; 1 - matches.
Parameters:
Normally used for Windows event logs.
Example:
Check if there has been a monotonous decrease in values.
Supported value types: Integer.
Returns: 1 - if all elements in the time period continuously decrease; 0 - otherwise.
Parameters:
Example:
monodec(/Host1/system.swap.size[all,free],60s) + monodec(/Host2/system.swap.size[all,free],60s) + monodec(/Host3/system.swap.size[all,free],60s) #calculate in how many hosts there has been a decrease in free swap size
Check if there has been a monotonous increase in values.
Supported value types: Integer.
Returns: 1 - if all elements in the time period continuously increase; 0 - otherwise.
Parameters:
Example:
monoinc(/Host1/system.localtime,#3,"strict")=0 #check if the system local time has been increasing consistently
Check for no data received.
Supported value types: Integer, Float, Character, Text, Log.
Returns: 1 - if no data received during the defined period of time; 0 - otherwise.
Parameters:
nodata(/host/key,0)
is disallowed.Comments:
nodata(/host/key,5m,"strict")
; in this case the function will fire as soon as the evaluation period (five minutes) without data has past.The P-th percentile of a period, where P (percentage) is specified by the third parameter.
Supported value types: Float, Integer.
Parameters:
The per-second average rate of the increase in a monotonically increasing counter within the defined time period.
Supported value types: Float, Integer.
Parameters:
Functionally corresponds to 'rate' of PromQL.
Example: