[ZBXNEXT-552] More mathematical functions to trigger and calculated item expressions Created: 2010 Nov 08  Updated: 2021 Jun 03  Resolved: 2021 May 21

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 1.8.3
Fix Version/s: 5.4.0

Type: Change Request Priority: Major
Reporter: Jori Hämäläinen Assignee: Unassigned
Resolution: Fixed Votes: 41
Labels: calculateditems, patch, triggerfunctions, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

LAMP with Zabbix 1.8.3


Attachments: File 0001-frontends-php-add-power-operator-support-for-trigger.patch     File 0001-zbxalgo-add-power-operator.patch     Text File zbx_expression.c_pow_sqrt.patch    
Issue Links:
Causes
causes ZBXNEXT-6544 New set of operators, mathematical an... Closed
Duplicate
duplicates ZBXNEXT-1444 Zabbix Lua Master Ticket Closed
is duplicated by ZBXNEXT-1388 additional operations for calculated ... Closed
is duplicated by ZBXNEXT-3486 new function for triggers - absolute(... Closed

 Description   

For statistical analysis of collected/polled Zabbix data some formulas needs to be used.

Variance needs ability to add to power of 2. (X ** 2 or X^2)
Standard deviation needs square root (of variance). ( SQRT(X) or X**0.5 or X^0.5)

Perhaps some others might need to have LN, LOG, EXP etc.

Example use case:
Cisco routers provide SLA monitoring and SNMP MIB returns NumberOfMeasures, SumOfMeasures and SumOfMeasuresSquared. From these 3 variables I can calculate

  • average RTT
  • variance of RTT
  • standard deviation of RTT

Unfortunately only last (standard deviation) needs to be calculated with external program as according to manual Zabbix does not support SQRT-function.

Also power could be used to combine two 32-bit counters to one 64-bit: counter + counterHigh*2^32 instead of counter + counterHigh*4294967296..

Luckily PHP has SQRT() and POW() for web interface based square rooting and powering. C++ math.h also has it. So it should not be that big thing or?



 Comments   
Comment by Jacobo Aragunde Pérez [ 2011 Jan 26 ]

I also need this functionality, and I'd like to try to contribute with a patch before implementing it as a part of my custom agent. Is somebody already working on this? Any advice on how to start?

Comment by richlv [ 2011 Jan 26 ]

that would be more in server not agent, though, wouldn't it ?
in any case, you might want to talk to nelsonab (freenode/#zabbix), he was playing around with lua integration

Comment by Jacobo Aragunde Pérez [ 2011 Jan 26 ]

Yes, I meant, I'd prefer to contribute with a patch to the server, and if not possible, I'd implement those operations in my custom agent, before sending the values to the server.

Comment by Vladimir Kravchenko [ 2012 Sep 01 ]

patch zbx_expression.c_pow_sqrt.patch for 2.0.3rc1, '^' = pow(), '2 ~' = sqrt()

Comment by Alexei Vladishev [ 2014 Sep 25 ]

See also ZBXNEXT-624

Comment by Marc [ 2014 Dec 29 ]

ZBXNEXT-2650 might help here too.

Comment by Oleksandr Natalenko [ 2016 Jun 30 ]

Patch for 3.0.3 implementing power operator (^).

Comment by Oleksandr Natalenko [ 2016 Jun 30 ]

Also, add power operator support for trigger expression in PHP frontend.

Comment by Raymond Kuiper [ 2016 Nov 10 ]

I would love to be able to use these in triggers and calculated items.

Comment by Vittorio Tranquillo [ 2019 Oct 24 ]

the features required in this ticket would be fundamental for our important project!
 

Comment by Branislav Žilka [ 2020 Feb 07 ]

We need either pow() function or ^ operator to calculate correct temperature sensor values from OIDs of scale and value received from SNMP agent in Cisco Nexus 9000. Desperately missing for setting up triggers, as temp sensors in same table have various scales. 

Comment by Alexei Vladishev [ 2021 May 21 ]

We have implemented a large set of new mathematical, statistical, string, bitwise and aggregate functions in Zabbix 5.4 under ZBXNEXT-6544. I think we can close this issue. If you need extra functions or we missed something then please open new tickets, preferably one ticket per function or per set of functions having similar application. I am closing this ticket.

Comment by Constantin Oshmyan [ 2021 Jun 03 ]

Is it possible to update the "Fix Version(s):" field of these issue, please?

Comment by Andris Mednis [ 2021 Jun 03 ]

Thanks! Done.

Generated at Thu Apr 25 14:52:32 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.