[ZBX-16161] Zabbix calculates the value of second part in an expression with AND, even if the first is false! Created: 2019 May 22  Updated: 2019 May 23  Resolved: 2019 May 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 4.0.6
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Victor Vislobokov Assignee: Edgar Akhmetshin
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-1906 [Patch] Process logical operations as... Open

 Description   

I have two data items: swap total and swap free. I created a trigger with condition:

{Custom Linux Memory Template:proc.meminfo.swaptotal.last()}>0 and (100*{Custom Linux Memory Template:proc.meminfo.swapfree.last()}/{Custom Linux Memory Template:proc.meminfo.swaptotal.last()})<10

At the systems with swap partition or swap file, it works fine, but at the systems where no swap, I got "Division by zero", but I expected that the trigger will not be up, because the first part of the contion ({Custom Linux Memory Template:proc.meminfo.swaptotal.last()}>0) is false!

In my opinion, there no meaning to calculate second part of the condition if the first part is false and "AND" will be lead to false in any case.



 Comments   
Comment by richlv [ 2019 May 22 ]

Duplicate of ZBXNEXT-1906.

Comment by Edgar Akhmetshin [ 2019 May 23 ]

Hello Victor,

Thank you for reporting the issue. A similar case registered under ZBXNEXT-1906 (thank you Rihards), so we will close this ticket and continue the discussion there. Feel free to follow the original case and vote for it.

Regards,
Edgar

Generated at Fri Apr 19 22:40:43 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.