To recreate the scenario:
- Create template
- Create macro with value of "5m" in template
- Create item in template using macro as interval
- Assign template to host
- Wait and watch until data comes in every 5 minutes
- Now unlink the template from the host
- The host now has an item with no associated macro defined
- In the server / proxy logs it will produce an error about invalid interval
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.