HostMetadataItem is an item key that will be evaluated and the result sent as HostMetadata, for example, system.uname
HostMetadata is just user defined string. Write there, what do you need. Example of Zabbix agent HostMetadataItem setting:
HostMetadata=:osname=Linux:env=staging:color=blue:docker=yes:app=apache:
Example Zabbix autoregistration with condition&operation for HostMetadataItem example above:
- Condition: Host metadata like :osname=Linux:; Operation: Link to templates: Template OS Linux
- Condition: Host metadata like :docker=yes:; Operation: Link to templates: Template App Docker
- Condition: Host metadata like :app=apache:; Operation: Link to templates: Template App Apache
- Condition: Host metadata like :env=staging:; Operation: Add to host groups: Staging servers
- Condition: Host metadata like :color=blue:; Operation: Add to host groups: Blue servers
- ...
If your autoregistration rules are complete, then you can delete your hosts from the Zabbix UI anytime. They will be autoregistered back in a few minutes with the right templates/group.