[ZBX-15954] Macros problems on Maps Created: 2019 Apr 05  Updated: 2024 Apr 10  Resolved: 2019 Jul 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.2.0
Fix Version/s: 4.2.5rc1, 4.4.0alpha1, 4.4 (plan)

Type: Problem report Priority: Trivial
Reporter: Gary Millar Assignee: Miks Kronkalns
Resolution: Fixed Votes: 2
Labels: macros, maps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File Zabbix.jpg    
Issue Links:
Causes
causes ZBX-16570 {HOST.NAME} Macros stopped to expend ... Closed
caused by ZBXNEXT-155 Support macros in URL map elements Closed
Duplicate
is duplicated by ZBX-16120 Map labels fail with external check v... Closed
is duplicated by ZBX-16404 Display item from external script in ... Closed
Team: Team B
Sprint: Sprint 52 (May 2019), Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
Story Points: 2

 Description   

I am having issues with Macros on the Maps Screen

The following Macros worked on v4.05

Current VMs = {{HOST.HOST}:vmbix[esx.vms.count,\{HOST.HOST}].last()}

SSL Valid = {{HOST.HOST}:zext_ssl_cert.sh[-d,\{HOST.CONN},\{$SSL_PORT}].last()}

The above just show UNKNOWN now

 



 Comments   
Comment by Miks Kronkalns [ 2019 Jun 18 ]

Hi boyemillar! Thank you for your contribution.

Please could you tell something more about keys of items you have used in your map? How originally keys look like in host configuration page and does it match with keys used in the map? Please replace sensitive details in item keys by some fake ones.

I tried to create a host using official "Template OS Linux" template and added 4 map host elements in my map for just created host with following labels:
1) {{HOST.HOST}:agent.ping.last()}
2) {{HOST.HOST}:vm.memory.size[total].last()}
3) {{HOST.HOST}:vm.memory.size[{$TOTAL}].last()}
4) {{HOST.HOST}:vm.memory.size\\{$TOTAL}.last()}

1st and 2nd macros returned last values for each of item used in functional macro. The 3rd and 4th macros was resolved as "UNKNOWN" text as you have mentioned in description but that's how I would expect it to work. All 4 samples worked equally in 4.0.0, 4.0.4, 4.0.5 as well as in all 4.0.x versions released later. What I'm doing differently from your case? I'm wondering how it would work for you in old releases.

Comment by Gary Millar [ 2019 Jun 20 ]

Hi Thanks for looking into this..

I first noticed this on our VDI map which pulls data via a template from our VMWare VCenter

On the map label for one of my items i'm using this

This is what used to work before we moved from v4.0.5 to v4.2.0

 

Comment by Miks Kronkalns [ 2019 Jul 04 ]

Resolved in feature/ZBX-15954-4.2

Comment by Gary Millar [ 2019 Jul 12 ]

Hi Miks

I have tried the changes you made to the /usr/share/zabbix/include/classes/macros/CMacrosResolver.php and it seems to have fixed the issue for me. The Macros which were not showing are now displaying fine.

Comment by Miks Kronkalns [ 2019 Jul 12 ]

Thank you boyemillar for feedback. Good to hear that problem is solved. The fix should be included in next minor release.

Comment by Miks Kronkalns [ 2019 Jul 18 ]

Fixed in:

  • 4.2.5rc1 3e869f100c7
  • 4.4.0alpha1 (master) 4dfb0aa4066
Generated at Fri Apr 26 15:36:51 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.