[ZBX-11347] Macros in web monitoring configuration does not expand in some places Created: 2016 Oct 11  Updated: 2017 May 30  Resolved: 2016 Nov 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Server (S)
Affects Version/s: 3.0.5
Fix Version/s: 2.2.16rc1, 3.0.6rc1, 3.2.2rc1, 3.4.0alpha1

Type: Incident report Priority: Blocker
Reporter: Kodai Terashima Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: macros, webmonitoring
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File host-configuration.png     PNG File latest-data-graph.png     PNG File latest-datta.png     PNG File macros_host_ip.png     PNG File scenario-configuration.png     PNG File scenario-configuration.png     PNG File step-configuration.png     PNG File web-monitoring-graph.png     PNG File web1.png     PNG File web2.png     PNG File web3.png    
Issue Links:
Duplicate
duplicates ZBX-5521 In 2.0.3rc1 system macros HOST.* not ... Open

 Description   

{HOST.*} macro can be used for web monitoring configuration. Zabbix server works as expected with the macros in Scenario name, URL, etc.

However, the macros are expanded to UNKNOWN in some places on frontend.



 Comments   
Comment by Ivo Kurzemnieks [ 2016 Oct 17 ]

(1) No translation string changes.

sasha CLOSED

Comment by Ivo Kurzemnieks [ 2016 Oct 17 ]

RESOLVED for 2.2 in svn://svn.zabbix.com/branches/dev/ZBX-11347-22

Comment by Alexander Vladishev [ 2016 Oct 17 ]

(2) frontends/php/include/classes/macros/CMacrosResolver.php:941,945,949 incorrect accessing to the boolean variable

sasha This code was completely rewritten in r63260 (4). WON'T FIX

Comment by Natalja Romancaka [ 2016 Oct 18 ]

(3) [F] in latest data {HOST.IP} and {HOST.CONN} are empty

iivs RESOLVED in r63232, r63236

natalja.zabbix ui succeffully tested

sasha It is not a proper fix. A new hack? REOPENED

iivs RESOLVED in r63272

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(4) [F] An alternative solution of resolving item key macros was implemented in r63260

iivs Looks like this revision broke something:

Undefined index: useip [latest.php:202 → CMacrosResolverHelper::resolveItemKeys() → CMacrosResolver->resolveItemKeys() → CMacrosResolverHelper::resolveHostInterfaces() → CMacrosResolver->resolve() → CMacrosResolver->resolveTexts() in C:\Development\ZBX-11347-22\frontends\php\include\classes\macros\CMacrosResolver.php:225]

Undefined index: useip [items.php:1069 → CMacrosResolverHelper::resolveItemNames() → CMacrosResolver->resolveItemNames() → CMacrosResolver->resolveItemKeys() → CMacrosResolverHelper::resolveHostInterfaces() → CMacrosResolver->resolve() → CMacrosResolver->resolveTexts() in C:\Development\ZBX-11347-22\frontends\php\include\classes\macros\CMacrosResolver.php:225]

Undefined index: useip [hosts.php:748 → CView->render() → include() → CMacrosResolverHelper::resolveItemNames() → CMacrosResolver->resolveItemNames() → CMacrosResolver->resolveItemKeys() → CMacrosResolverHelper::resolveHostInterfaces() → CMacrosResolver->resolve() → CMacrosResolver->resolveTexts() in C:\Development\ZBX-11347-22\frontends\php\include\classes\macros\CMacrosResolver.php:225]

REOPENED

sasha Thanks! RESOLVED in r63301.

iivs CLOSED

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(5) [F] What corrects this change?

frontends/php/httpdetails.php

@@ -324,7 +324,6 @@
 ));
 
 $src = 'chart3.php?height=150'.
-       '&name='.$httpTest['name'].
        '&http_item_type='.HTTPSTEP_ITEM_TYPE_TIME.
        '&httptestid='.$httpTest['httptestid'].
        '&graphtype='.GRAPH_TYPE_STACKED.

iivs RESOLVED in r63273

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(6) Not all macros are resolved in Monitoring->Web pages

  • Monitoring->Details of scenario
  • Monitoring->Status of Web monitoring
  • Web scenario
  • Interface

sasha RESOLVED in r63274

natalja.zabbix ui tested

iivs CLOSED

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(7) [S] Server side also must be rewritten to support resolving of interface macros by priority.

asaveljevs Just to document the current state: in Zabbix 3.0, processing of Web scenarios works correctly with macros, and {HOST.CONN}, {HOST.IP}, and {HOST.DNS} are resolved correctly in trigger names with Web items in notifications, but are not resolved for Web items themselves.

asaveljevs RESOLVED in r63730 for 2.2 branch and in r63731 for 3.0 branch.

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(8) [F] Fixed resolving of {HOST.IP}, {HOST.DNS} and {HOST.CONN} macros by priority in web scenarios and item keys in r63278

iivs CLOSED

Comment by Ivo Kurzemnieks [ 2016 Oct 24 ]

(9) [F] Merged the fix to 3.0 dev branch svn://svn.zabbix.com/branches/dev/ZBX-11347
Please see if anything is amiss.

sasha CLOSED

Comment by Natalja Romancaka [ 2016 Oct 25 ]

(10) [F] 3.0 on Latest data page Undefined index, if exist web scenario with macros {HOST.IP}, {HOST.DNS}, {HOST.CONN} and macros *UNKNOWN*

Undefined index: hosts [latest.php:183 → CMacrosResolverHelper::resolveItemKeys() → CMacrosResolver->resolveItemKeys() in include/classes/macros/CMacrosResolver.php:1417]

sasha RESOLVED in r63345, r63346

natalja.zabbix ui tested

iivs The undefined index is gone and having selected one host with one default interface works fine, but having selected a group with that host plus more hosts that hove many another interfaces, the first one shows *UNKNOWN*.

REOPENED

sasha RESOLVED in r63401

iivs Great!
CLOSED

Comment by Natalja Romancaka [ 2016 Oct 25 ]

(11) [F] 3.0 on page Monitoring->Web 500 Internal Server Error, if exist web scenario with macros {HOST.IP}, {HOST.DNS}, {HOST.CONN}

sasha RESOLVED in r63350

natalja.zabbix ui tested

iivs CLOSED

Comment by Alexander Vladishev [ 2016 Oct 25 ]

(12) [F] minor code improvements in r63342, r63343

iivs CLOSED

Comment by Ivo Kurzemnieks [ 2016 Oct 26 ]

(13) [F] 3.0 httpdetails.php graphs show incomplete name due to incorrect url encoding.

sasha RESOLVED in r63402

iivs Thanks!
CLOSED

Comment by Alexander Vladishev [ 2016 Nov 14 ]

(14) Documentation

  • What's new pages 2.2.16, 3.0.6 and 3.2.2
  • footnotes in "Macros supported by location" page must be updated in version 2.2, 3.0, 3.2 and 3.4

martins-v RESOLVED. Please review.

sasha Excellent! CLOSED with small clarifications in "What's new" pages.

Comment by Alexander Vladishev [ 2016 Nov 14 ]

Released in:

  • pre-2.2.16rc1 r63762
  • pre-3.0.6rc1 r63763
  • pre-3.2.2rc1 r63764
  • pre-3.3.0 (trunk) r63765
Comment by richlv [ 2016 Dec 16 ]

looks like this has introduced a regression in webmonitoring (both of the default graphs showing the same data) : ZBX-11613

Generated at Fri Apr 19 21:26:53 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.