[ZBXNEXT-5079] Option to copy the template macros to the linked host when unlinking the template from the host. Created: 2019 Feb 27 Updated: 2022 Apr 15 Resolved: 2022 Apr 15 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | API (A), Frontend (F) |
Affects Version/s: | 4.0.5 |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Minor |
Reporter: | James Cook | Assignee: | Zabbix Support Team |
Resolution: | Duplicate | Votes: | 2 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Zabbix 3.4.15 & Zabbix 4.0.5 |
Issue Links: |
|
Description |
To recreate the scenario:
The above is the same for any macro used in any field in an item or trigger and at scale we have found these errors crash our server and it becomes unresponsive, especially during a configuration cache update. When unlinking a template macros should be unlinked as per items, triggers, graphs. If they dont exist on the host / template as macro override they should be created directly on the host/template. When linking a template macros should be linked as per items, triggers, graphs. If they exist as a macro override and the value is different then the macro should remain on the host. If they exist as a macro overide and the value is identicle the macro should be removed from the host. At this point the only way to prevent these errors from crashing our servers is to ensure the templates macros are also present as global macros which is probably not the best way.
|
Comments |
Comment by richlv [ 2019 Feb 27 ] |
This works as designed. While creating a copy of the macro upon unlinking is an interesting idea, it might cause unexpected config proliferation. With that said, why are you unlinking the templates? |
Comment by Arturs Lontons [ 2019 Feb 28 ] |
Hi, James. Going by our documentation, I'd have to say that the behavior you're describing is implied by our documentation. Meaning that it's not mentioned anywhere that the macros should under any circumstances be copied between different macro levels (template -> host, for example) |
Comment by James Cook [ 2019 Mar 05 ] |
Hi Rich / Arturs, Thanks for your feedback. Why are we unlinking templates? We have been in a couple of situations where we needed to unlink (not clear) and link another template to it and avoid loosing data; to reorganize our template structure across hosts. Unfortunately this took time and the configuration update occurred locking our system as it reported thousands of unknown macros in the server logs and the configuration update never finsihed etc... I was thinking an option only (default behavior is disabled) when unlinking and clearing to manage macros. This way there would be no change in behavior unless people wanted to do so. It might cause unexpected config proliferation - I was aware about the configuration remnants in the situation where the template is unlinked and the macro is not in any newly linked templates, thus leaving unused ones behind. This is the problem to solve as there is no real automatic safe way to remove unused macros from a host as you would have to check all areas where macros can be used... I guess there underneath this request the actual fact where the macro was no longer present used for intervals / history - trend periods. When there it only complains about a few items with invalid intervals it functions normally and it only locks up when thousands it items have invalid intervals. We currently are running at 8200 nvps spread over 2256925 items across 12219 hosts. Regards James |
Comment by James Cook [ 2019 Mar 19 ] |
Hi Rich / Arturs, Is there any thoughts on my feedback? One point I would like to make about the config proliferation, is that its the same side effect for all zabbix objects that get unlinked.from the template (items / triggers / graphs etc...) The reality is the administrator should be on top of what is occuring etc... Regards James |
Comment by richlv [ 2019 Apr 01 ] |
That is an interesting usecase. While redesigning templates is not a frequent occurrence usually, having an option to copy usermacros when unlinking [and clearing] seems like a useful and possible solution. |
Comment by James Cook [ 2020 Mar 14 ] |
Hi Rich, Maybe on the operation of assigning/linking templates an option can be 'Remove Duplicate Macros' when linking may also be handy... Example: HostX has macro {$MACRO1} with a value of 'abc' and HostX is linked to a template with a macro {$MACRO1} with a value of 'abc', then the HostX macro {$MACRO1} would be removed if the 'Remove Duplicate Macros' option is selected... Only if macro/value match exactly. Cheers James |
Comment by Oleksii Zagorskyi [ 2022 Apr 15 ] |
There is basically an identical report - ZBXNEXT-5683 Closing this as duplicate. |