[ZBX-11698] Host level context macro not resolved correctly in name/description fields problem view Created: 2017 Jan 12  Updated: 2018 Jul 23  Resolved: 2017 Jan 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: 3.2.2
Fix Version/s: 3.0.8rc1, 3.2.4rc1, 3.4.0alpha1

Type: Incident report Priority: Major
Reporter: David Angelovich Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: context, macro, macros, regression, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RH7, MySQL


Attachments: PNG File Screen Shot 2017-01-17 at 8.28.28 PM.png     PNG File Screen Shot 2017-01-17 at 8.28.43 PM.png     PNG File Screen Shot 2017-01-18 at 5.39.00 AM.png     PNG File Screenshot from 2017-01-11 16-57-45.png     PNG File Screenshot from 2017-01-11 16-58-42.png     PNG File Screenshot from 2017-01-11 16-59-02.png    
Issue Links:
Duplicate
is duplicated by ZBX-11815 Displaying macro context in graphs is... Closed
is duplicated by ZBX-11797 Problem with {$MACRO:context} in trig... Closed

 Description   

Where a context macro is used, the trigger name and description fields do not resolve the macro correctly.

--Trigger--
Name: Filesystem {#FSNAME} is >{$WARNING_VOLUME_USAGE:"{#FSNAME}"} full: {ITEM.LASTVALUE}
Expression: {myhost.example.com:netapp.dfPerCentKBytesCapacity[{#FSNAME}].last()}>={$WARNING_VOLUME_USAGE:"{#FSNAME}"}
Description:
One: {$WARNING_VOLUME_USAGE:{#FSNAME}}
Two: {$WARNING_VOLUME_USAGE:{"#FSNAME"}}
--Host--
Macros:
{$WARNING_VOLUME_USAGE} = 87
{$WARNING_VOLUME_USAGE:/vol/KVM01} = 70

The item returns a value of 83, and the trigger alerts - but the name in the alert is:

Filesystem /vol/KVM01 is >87} full: 83 %

So clearly the macro override is being respected in the trigger expression, but just not resolving correctly in the name. The description also has this issue, and displays as:

One: 87}
Two: 87

Also tried using the context macro without quotes in the trigger name, but didn't resolve that either.



 Comments   
Comment by David Angelovich [ 2017 Jan 12 ]

Description with noformat tags - seems Jira made a mess of my text.

Where a context macro is used, the trigger name and description fields do not resolve the macro correctly.

--Trigger--
Name: Filesystem {#FSNAME} is >{$WARNING_VOLUME_USAGE:"{#FSNAME}"} full: {ITEM.LASTVALUE}
Expression: {myhost.example.com:netapp.dfPerCentKBytesCapacity[{#FSNAME}].last()}>={$WARNING_VOLUME_USAGE:"{#FSNAME}"}

Description:
One: {$WARNING_VOLUME_USAGE:{#FSNAME}}
Two: {$WARNING_VOLUME_USAGE:{"#FSNAME"}}


--Host--
Macros:
{$WARNING_VOLUME_USAGE} = 87
{$WARNING_VOLUME_USAGE:/vol/KVM01} = 70


The item returns a value of 83, and the trigger alerts - but the name in the alert is:
Filesystem /vol/KVM01 is >87} full: 83 %

So clearly the macro override is being respected in the trigger expression, but just not resolving correctly in the name. The description also has this issue, and displays as:
One: 87}
Two: 87

Also tried using the context macro without quotes in the trigger name, but didn't resolve that either.
Comment by Alexander Vladishev [ 2017 Jan 12 ]

Context macros in the descriptions are not properly quoted. Please try a correct syntax:

{$WARNING_VOLUME_USAGE:"{#FSNAME}"}
Comment by Alexander Vladishev [ 2017 Jan 12 ]

I close this issue as "Won't Fix".

Comment by David Angelovich [ 2017 Jan 12 ]

That was a typo while I was writing this ticket - I had actually tested with the correct syntax as you specified (see screenshot), but it also did not work.
I'm more concerned about the way the Trigger Name field resolves that description, though they both appear to be misbehaving.

Comment by Alexander Vladishev [ 2017 Jan 13 ]

Please attach a screenshot of the configuration form of the trigger from this screenshot:

Comment by David Angelovich [ 2017 Jan 18 ]

Sorry for the delay, I've been quite sick.

Attached requested images.

Comment by Vladislavs Sokurenko [ 2017 Jan 18 ]

Hello! Thank you for a screen shot, does it help if in macros section you define context macro as {$WARNING_VOLUME_USAGE:"/vol/KVM01"} = 70

Comment by David Angelovich [ 2017 Jan 18 ]

Changed the macro definition on the host, but it didn't appear to make any difference to the trigger definition or the way the trigger name/description is displayed (still using the incorrect value).

Unable to render embedded object: File (Screen Shot 2017-01-18 at 5.39.00 AM.png ) not found.

Comment by Vladislavs Sokurenko [ 2017 Jan 18 ]

Reproduced in 3.2.4rc1

Context in host level macro is ignored by frontend however server works as expected.

Host level macros:

{$WARNING_VOLUME_USAGE:"/"}=>888
{$WARNING_VOLUME_USAGE}=>999

Trigger prototype name:

{#FSNAME} context {$WARNING_VOLUME_USAGE:"{#FSNAME}"} no context {$WARNING_VOLUME_USAGE}

When receiving notification then macros are resolved correctly:
/ context 888 no context 999

However when viewing problem in frontend there is different behavior:
/ context 999 no context 999

Same problem is in description and expression and possibly in other fields

Comment by Alexander Vladishev [ 2017 Jan 19 ]

A regression, caused by ZBX-8457.

Comment by Alexander Vladishev [ 2017 Jan 19 ]

(1) No translation strings changed

oleg.egorov CLOSED

Comment by Alexander Vladishev [ 2017 Jan 19 ]

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

Comment by Oleg Egorov (Inactive) [ 2017 Jan 19 ]

TESTED

Comment by Alexander Vladishev [ 2017 Jan 20 ]

Fixed in:

  • pre-3.0.8rc1 r65187
  • pre-3.0.4rc1 r65188
  • pre-3.3.0 (trunk) r65189
Comment by richlv [ 2018 Jul 23 ]

(2) Typo in the changelog entry:

fixed resolving of user macros with context wich are defined on host or template level

Note the misspelling of "which". Also, language-wise, perhaps "that" is a better fit here.

Generated at Fri Mar 29 11:50:31 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.