If the result of "bitwise AND" is equal to number_to_compare_with, the value is counted. count() calculates "bitwise AND" from the value and the mask and compares the result to number_to_compare_with. With band as third parameter, the second parameter can be specified as two numbers, separated by '/': number_to_compare_with/mask. Supported value types: float, integer, string, text, logįloat items match with the precision of 0.000001. Like (default), eq, ne are supported for string, text and log items Like - matches if contains pattern (case-sensitive)īand - bitwise AND (supported since Zabbix 2.2.0).Įq (default), ne, gt, ge, lt, le, band are supported for integer itemsĮq (default), ne, gt, ge, lt, le are supported for float items Number of values within the defined evaluation period. The amount of difference between last and previous values. This function is supported since Zabbix 2.2.0. => band(,20)=16 → 3rd bit not set and 5th bit set. => band(,12)=8 or band(,12)=4 → 3rd or 4th bit set, but not both at the same time For example, checking for the 3rd bit is done by comparing to 4, not 100. Take note that #num works differently here than with many other functions (see last()).Īlthough the comparison is done in a bitwise manner, all the values must be supplied and are returned in decimal.
Sec (ignored) or #num - the Nth most recent value Value of "bitwise AND" of an item value and mask. It is useful when there is a need to compare the current average value with the average value time_shift seconds back.
The time_shift parameter is supported since Zabbix 1.8.2.
=> avg(3600,86400) → average value for an hour one day ago. => avg(#5) → average value for the five latest values Time_shift (optional) - evaluation point is moved the number of seconds back in time Sec or #num - maximum evaluation period 1 in seconds or in latest collected values (preceded by a hash mark) Supported value types: float, int, str, text, logĪverage value of an item within the defined evaluation period. I found that out while going to latest data, checking the timestamp and converting it to actual time.The amount of absolute difference between last and previous values. When I configured the script to return a timestamp, I changed it to a different timezone instead of living it as it is, which actually compared the data with current time + 2 hours in the future :) so besides actually getting the triggers to work properly everything else is well configured. the problem is that it returns a critical error. PGPASSWORD= -U -t -c "" | awk '=0 so if the last insert time is greater then 5 minutes to return a critical error. I perform the query and send the output to zabbix_sender with the following template: #!/bin/bash Ok so first thing I did is created a bash files at /etc/zabbix/mytools, get-last-insert-time.sh. it's probably not cause it's not working :) all I did so far is for googling, not sure if that's the way to go. If the last inserted row have a insert time of more then 5 minutes to product warning and 10 minutes to product error. I have a a table that I want to check a timestamp column for the last inserted row.
I have a postgresql plugin configured and working properly so it checks my database metrics. I have Zabbix 4.4.1 installed on Ubuntu 19.10.