[ZBX-15494] Not supported custom multiplier to some value of scientific notations Created: 2019 Jan 23  Updated: 2024 Apr 10  Resolved: 2019 Feb 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 4.0.3
Fix Version/s: 3.0.26rc1, 4.0.5rc1, 4.2.0beta1, 4.2 (plan)

Type: Problem report Priority: Minor
Reporter: Dmitriev Evgeniy Assignee: Andrejs Sitals (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1.png     PNG File 2.png     PNG File 3.png     PNG File 4.png    
Team: Team A
Sprint: Sprint 48, Jan 2019, Sprint 49 (Feb 2019)
Story Points: 0.125

 Description   

Steps to reproduce:

  1. Create test item (See screenshot 1)
  2. zabbix_sender -z 127.0.0.1 -p 10051 -s test -k value -o "0.0E-07"
  3. OK, see screenshot 2
  4. zabbix_sender -z 127.0.0.1 -p 10051 -s test -k value -o "0.0E+00"
  5. OK, see screenshot 2

 

  1. Add custom multiplier (See screenshot 3)
  2. zabbix_sender -z 127.0.0.1 -p 10051 -s test -k value -o "0.0E-07"
  3. OK
  4. zabbix_sender -z 127.0.0.1 -p 10051 -s test -k value -o "0.0E+00"
  5. Error "Item preprocessing step #1 failed: cannot apply multiplier "1000000" to value "0.0E+00" of type "string": cannot convert value to numeric type", see screenshot 4

 



 Comments   
Comment by Andrejs Sitals (Inactive) [ 2019 Jan 29 ]

zbx_variant_set_numeric() calls del_zeros() before passing value to is_uint64() and/or is_double() which ruins the value. Current implementation of del_zeros() functions removes trailing zeros and "." from the value, e.g., "10.0" becomes "10", "10.1000" becomes "10.1".

When using scientific notation, this results in:

  • getting error messages when using 0 as exponent (e.g., "1.0e0" becomes "1.0e", "1.0e+0" becomes "1.0e+");
  • getting invalid results when using exponent that is multiple of tens (e.g., 1.0e100 is converted to 1.0e1).
Comment by Andrejs Sitals (Inactive) [ 2019 Jan 29 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-15494

Comment by Andrejs Sitals (Inactive) [ 2019 Feb 14 ]

Available in versions:

  • pre-3.0.26rc1 r89783
  • pre-4.0.5rc1 r89784
  • pre-4.2.0alpha4 (trunk) r89785
Generated at Fri Apr 26 02:13:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.