Все перечисленные здесь функции поддерживаются в:
Функции перечислены без дополнительной информации. Нажмите на функцию, чтобы увидеть полную информацию.
Функция | Описание |
---|---|
change | Разница между предыдущим и последним значением. |
changecount | Количество изменений между соседними значениями в течение определенного периода оценки. |
count | Количество значений в течение определенного периода оценки. |
countunique | Количество уникальных значений в течение определенного периода оценки. |
find | Найти совпадение значения в течение определенного периода оценки. |
first | Первое (самое старое) значение в пределах определенного периода оценки. |
fuzzytime | Проверка того, насколько время пассивного агента отличается от времени сервера/прокси Zabbix. |
last | Самое последнее значение. |
logeventid | Проверка, соответствует ли идентификатор события последней записи журнала регулярному выражению. |
logseverity | Серьезность последней записи журнала. |
logsource | Проверка, соответствует ли источник журнала последней записи журнала регулярному выражению. |
monodec | Проверка, наблюдается ли монотонное уменьшение значений. |
monoinc | Проверка, наблюдается ли монотонное увеличение значений. |
nodata | Проверка отсутствия полученных данных. |
percentile | P-й процентиль периода, где P (процент) указывается третьим параметром. |
rate | Средняя скорость увеличения в секунду монотонно увеличивающегося счетчика в течение определенного периода времени. |
/узел_сети/ключ
является общим обязательным первым параметром для функций, ссылающихся на историю элемента данных узла сети(сек|#число)<:сдвиг_времени>
является общим вторым параметром для функций, ссылающихся на историю элемента данных узла сети, где:
Некоторые общие замечания о параметрах функций:
<
>
/host/key
и (sec|#num)<:time shift>
никогда не должны заключаться в кавычкиThe 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()
is always equal to last(#1)
; last(#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: