[ZBXNEXT-3446] Group and item prototype based trigger functions for aggregation Created: 2016 Sep 19 Updated: 2021 May 22 Resolved: 2021 May 22 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | 3.4.0alpha1 |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Minor |
Reporter: | Glebs Ivanovskis (Inactive) | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 6 |
Labels: | aggregate, calculateditems, performance, triggerfunctions, usability | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
Currently trigger functions are bound to one host:item but aggregated items are slow, provide very restricted set of group and item functions and can be used only one at a time. Situation can be improved by introducing a few new concepts. Group based trigger functionsIn addition to existing host:item.func(params) (in triggers), func(host:item,params) and func(item,params) (in calculated items) syntax trigger functions should support host arrays and host group arrays like aggregated items:
When used with array of hosts, host group or array of groups function will produce arrays of values, each value being function result for a single host:item. Then such arrays can be converted to a single value using... Standalone trigger functionsThese should include functions for converting arrays of values into single value in different ways. Suggested functions and syntax:
Standalone functions can also implement advanced mathematical functions like exp(), log(), sin(), cos(), sqrt(), etc. (Requested in Under the hood standalone functions are basically unary operators with right-to-left associativity (like not and unary minus) acting on arrays of values. Arrays are composed of individual values using "append value" operator ; with left-to-right associativity. ExampleWith new functionality it will be possible to substitute aggregated item like grpavg["MySQL Servers",mysql.qps,avg,5m] with a calculated item arr_avg(avg(MySQL Servers::mysql.qps,5m)) or use it directly in a trigger arr_avg({MySQL Servers::mysql.qps.avg(5m)}) Such aggregation will use value cache and offer more flexibility in the form of all additional parameters supported by conventional trigger functions. Here is an example of a trigger firing when amount of error messages on Web and SQL servers exceeds 100 for the past hour: arr_sum({[Web Servers,SQL Servers]::log[/path/to/file,error].count(1h)})>100 Equivalent calculated item to demonstrate "functional" syntax: arr_sum(count("[Web Servers,SQL Servers]::log[/path/to/file,error]",1h))>100 Probably, such array based technique can be applied to the aggregation of items created from item prototypes ( arr_sum({host:net.if.in[{#IFNAME}].avg(1h)})>{$LIMIT} Equivalent calculated item to demonstrate "functional" syntax: arr_sum(avg(host:net.if.in[{#IFNAME}],1h))>{$LIMIT} |
Comments |
Comment by Aleksandrs Saveljevs [ 2016 Sep 20 ] |
Standalone functions also requested in |
Comment by Glebs Ivanovskis (Inactive) [ 2016 Oct 02 ] |
This can be a solution for |
Comment by Alexei Vladishev [ 2021 May 22 ] |
Implemented in Zabbix 5.4 under |
Comment by Glebs Ivanovskis [ 2021 May 22 ] |
Please consider linking this issue and |
Comment by Alexei Vladishev [ 2021 May 22 ] |
Linked to |
Comment by Glebs Ivanovskis [ 2021 May 22 ] |
Thank you! |