[ZBXNEXT-756] Trigger function percentile Created: 2011 Apr 14  Updated: 2015 Sep 14  Resolved: 2014 Dec 08

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A), Frontend (F), Server (S)
Affects Version/s: None
Fix Version/s: 2.5.0

Type: New Feature Request Priority: Minor
Reporter: Sergey Kononenko Assignee: Unassigned
Resolution: Fixed Votes: 10
Labels: patch, percentile
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File ZBXNEXT-756_add_percentile_trigger_function-2.4.2.patch     File add_percentile_trigger_function-2.0.7.patch     File add_percentile_trigger_function-2.2.1.patch     File add_percentile_trigger_function-2.2.4.patch     File percentile-18770.patch    
Issue Links:
Duplicate
is duplicated by ZBXNEXT-624 besides average a mathematical functi... Closed
is duplicated by ZBXNEXT-1226 Graph percentile from API Open
is duplicated by ZBXNEXT-1095 Better 95th percentile calculation Open

 Description   

Statistical function percentile (http://en.wikipedia.org/wiki/Percentile) widely used by ISP for billing purposes to measure bandwidth level without random peaks (95th percentile). So I think it will be useful to add percentile to Zabbix trigger function. So users can create monitoring rules to warn then traffic goes beyond billing limit.
Also 95th is a good measure for "regular" maximum of traffic bandwidth, and 5th percentile for "regular" minimum. So that function will be useful in triggers which detect various anomalies in traffic.
I've attach patch with my realization of percentile function. It is against last 1.8.x svn snapshot. I've tested it with Zabbix 1.8.5rc1. It can be applied without errors to trunk svn tree, but I didn't test it with trunk.
Function has three arguments:
first is number of percentile, e.g. 95, 5 or something else.
other two arguments exactly like in avg, min or max functions, length of period (sec or #num) and optional time shift (sec)
There is only small issue with trigger popup window (which adds function to trigger expression), looks like it can't hadle function with three arguments. And I'm not expert in PHP and webinterfaces and don't know how to fix it.
The patch is completely unintrusive, so I hope it can be applied even to 1.8.x branch of Zabbix.

Specification



 Comments   
Comment by hamid sfandiari [ 2011 Aug 02 ]

very useful patch... thanks

Comment by Michael OBrien [ 2011 Dec 01 ]

This does not apply against 1.9.x, just FYI.

Comment by Michael OBrien [ 2011 Dec 01 ]

I was able to make the PHP parts of the patch work in 1.9.x, but the C side goes over my head - I was able to find where it 'fit', but build failed as that C file now no longer includes find_table_by_value_type.

Comment by Oleksii Zagorskyi [ 2012 Feb 23 ]

Linked connected issue ZBXNEXT-1095.

Comment by richlv [ 2012 Apr 19 ]

as hamid noted, another potentially interesting parameter would be "time period", thus allowing to calculate percentile only for "billing period" (for example, if isp is billing only for working hours etc)

Comment by Corey Shaw [ 2013 Oct 03 ]

Here's a percentile trigger function for Zabbix 2.0.7 (works in 2.0.8 as well).

Comment by Volker Fröhlich [ 2013 Oct 04 ]

Corey, I might be wrong, but I think your patch is re-implementing existing functions. For instance, please take a look at zbx_default_uint64_compare_func()in src/libs/zbxalgo/algodefs.c!

Comment by Corey Shaw [ 2014 Jan 14 ]

Attached a version of this for 2.2.1. Based on Volker's comment, the duplicate function is no longer used.

Comment by Corey Shaw [ 2014 Sep 30 ]

Added patch for Zabbix 2.2.4

Comment by Corey Shaw [ 2014 Nov 12 ]

Ported to Zabbix 2.4.2.

ZBXNEXT-756_add_percentile_trigger_function-2.4.2.patch

Comment by Aleksandrs Saveljevs [ 2014 Dec 01 ]

Server side ready in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-756 , handing over for frontend development.

Comment by Aleksandrs Saveljevs [ 2014 Dec 03 ]

(1) [F] Translation strings introduced:

  • Percentage
  • Percentile P of a period T is < N
  • Percentile P of a period T is > N
  • Percentile P of a period T is = N
  • Percentile P of a period T is NOT N

sasha CLOSED

Comment by Aleksandrs Saveljevs [ 2014 Dec 03 ]

Frontend side done in the same development branch and is ready for testing.

Comment by Alexander Vladishev [ 2014 Dec 08 ]

(2) Made some minor changes in r51061:51062. Please review.

asaveljevs Looks good, CLOSED.

Comment by Aleksandrs Saveljevs [ 2014 Dec 08 ]

(3) Percentage field in trigger popup should have the same length as the T_ZBX_INT fields. Currently, it is very wide, because it has T_ZBX_STR type.

asaveljevs RESOLVED in r51066.

sasha CLOSED

Comment by Aleksandrs Saveljevs [ 2014 Dec 08 ]

Available in pre-2.5.0 (trunk) r51070.

Comment by Aleksandrs Saveljevs [ 2014 Dec 08 ]

(4) Documented at the following locations:

sasha Added "notifications" where new function can be used. Accepted by asaveljevs.

CLOSED

Generated at Wed Apr 24 23:44:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.