[ZBX-3993] second level nested template usermacros do not work over proxy Created: 2011 Jul 28  Updated: 2017 May 30  Resolved: 2011 Aug 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: None
Fix Version/s: 1.8.7

Type: Incident report Priority: Critical
Reporter: richlv Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1.8.6rc1



 Description   

test configuration :

template1 -> template2 -> host

in host agent :
UserParameter=macro[*],echo '$1' > /tmp/macro.txt; echo 1
UnsafeUserParameters=1

in template1 (only !) : user macro "{$MACRO}"

create agent item (both active and passive fail) with key "macro[{$MACRO}]" (frontend resolves this properly if $1 is used in description).

on host, {$MACRO} is written to the debug.

works fine if usermacro is defined on template2



 Comments   
Comment by Alexander Vladishev [ 2011 Jul 30 ]

Confirmed in the 1.8 branch, r20872.

Comment by Alexander Vladishev [ 2011 Jul 31 ]

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

Comment by richlv [ 2011 Jul 31 ]

thanks for the speedy fix
described problem seems to be gone in dev branch rev 20874

(1) might be unrelated, but the following unexpected behaviour can be observed :

a) follow the same steps as to reproduce the original problem. notice that it works ok now.
b) override the macro on template2 (add macro with same name but different value).
c) reload proxy config cache. according to my understanding, this is supposed to retrieve all config without any caching involved (verifying the proxy data, at least changes in item config seem to be picked up as expected)
d) restart active agent. it should now have all the latest config.
e) observe old macro value still being written to the file
f) let it run for a while. after some time period correct macro value (from template2) will start to appear in the debug file

<sasha> caching of macros in a version 1.8 is perform each processes separately (not by a global configuration cache), and refresh it each 5 min. Therefore there is such problem. In a version 2.0 macros are cached by a configuration cache.

<richlv> does "by each process" here refer to individual daemon processes (like poller etc) ?

<asaveljevs> What is the other way to understand it?

<richlv> "server", "proxy"

<asaveljevs> Ah, then yes, in 1.8 macros are cached individually by each daemon process.

Comment by Alexander Vladishev [ 2011 Aug 05 ]

Fixed in version pre1.8.7, r20952

Generated at Fri Apr 26 12:22:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.