[ZBXNEXT-2374] New trigger function rate() Created: 2014 Jul 09  Updated: 2021 May 21  Resolved: 2021 May 21

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Documentation (D), Server (S)
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Minor
Reporter: Volker Fröhlich Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: newtriggerfunction, patch, rate
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File ZBXNEXT-2374.patch     Text File ZBXNEXT-2374.patch     Text File added_Rate.patch    

 Description   

Consider the following raw data:

10:00 – 100
11:00 – 150
12:00 – 600

The following change rates can be derived:

?
+50/h
+450/h

Keeping the rates as a separate item seems somewhat inefficient for this task and is complicated due to ZBXNEXT-1049.

Without the separate item, if I wanted to trigger on a particular rate (s^-1), I can try to compare "(LAST minus PREV) / hardcoded interval" or even "DIFF / hardcoded interval". The problem there is, if the item interval changes or is not constant in the first place (trapping!), the result is wrong.

I would like to see a trigger function like the following:

Function | Parameter(s) | Supported value types
--------------------------------------------------------------------
rate | sec or #num | float, int

The rate of change in a period; The period is set in seconds or as a number of collected values (preceded by a # hash mark) in the first parameter.

The function accepts a second, optional parameter time_shift.



 Comments   
Comment by James Burns [ 2015 May 24 ]

This is based on 2.4.2

Here is a possible solution to this issue.
in the checks_aggregate.c we could perform the following calculation to get the gradient of a list of points.

This could be used with two or more points, however using with more than two will be sensitive to outliers.

I must warn you that this is my first attempt at creating a patch.

I hope this helps

Comment by richlv [ 2015 May 24 ]

heya, the attachment seems to be email with the patch in some weird format (it also includes your email address).

you might want to try to create the patch by running one of the following (depending on how you obtained the sources) :

  • svn diff > file.patch
  • diff -u <oldfile> <newfile> > file.patch
Comment by James Burns [ 2015 May 25 ]

updated patch file as previous one was garbled

Comment by James Burns [ 2015 May 25 ]

Full Patch for 2.4.2 enabling the rate function in the frontend and backend.

rate can be called from trigger, selected from the dropdown and also used as a calculated item. the function can take either a number of items, or a timespan. if the

the rate takes into consideration the timestamp of each value it comes across to calculate the gradient/rate of change on a per second basis.

if this is used with more than two values, the outcome will be sensitive to outliers.

Comment by Alexei Vladishev [ 2021 May 21 ]

I believe it can be easily configured starting from Zabbix 5.4 using calculated items and absolute time periods.

Generated at Sat Apr 12 09:20:42 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.