[ZBX-20396] Incorrect converting of last() function when import template 5.0 in Zabbix 6.0 Created: 2021 Dec 28  Updated: 2024 Apr 10  Resolved: 2022 Feb 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: None
Fix Version/s: 5.0.21rc1, 5.4.11rc1, 6.0.0rc1, 6.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Maxim Chudinov (Inactive) Assignee: Maxim Chudinov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team INT
Sprint: Sprint 84 (Jan 2022), Sprint 85 (Feb 2022)
Story Points: 0.5

 Description   

Steps to reproduce:

  1. Take MySQL template from repo https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/mysql_agent?at=refs%2Fheads%2Frelease%2F5.0
  2. Import into Zabbix 6.0

Result:
The formula in "Calculated value of innodb_log_file_size" item became (last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written)) / {$MYSQL.INNODB_LOG_FILES}

Expected:
(last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written, #1:now-1h)) / {$MYSQL.INNODB_LOG_FILES}



 Comments   
Comment by Alexander Vladishev [ 2022 Jan 05 ]

Zabbix server and API converts this expression correctly because seconds are ignored in the last() function. From version 5.4 seconds are not supported. See documentation.

Original expression (before conversion): 

(last(mysql.innodb_os_log_written) - last(mysql.innodb_os_log_written,1h)) / {$MYSQL.INNODB_LOG_FILES} 

This expression should be fixed since result of this calculated item will be always zero.

Comment by Maxim Chudinov (Inactive) [ 2022 Feb 01 ]

Available in:

Generated at Fri May 02 10:44:42 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.