I’m administering a Zabbix 2.2.9 installation. I am attempting to flexibly map templates to hosts by associating the templates with specific flags in the HostMetadata field. I have successfully associated a template with a host via an action with a “HostMetadata like <token>” condition where the HostMetadata line in zabbix_agentd.conf has the following format:
The Actions I’m attempting to apply have the following format:
Condition: host metadata like <token>
Operations:
- Add host
- Add to host groups: Test Group
- Add to host groups: Discovered hosts
- Link to Templates: <token-specific_template>
The documentation clearly suggests, by way of example, that Zabbix can parse multiple whitespace-delimited tokens (see “Active Agent Auto-registration, https://www.zabbix.com/documentation...o_registration). In practice, I have been unable to map multiple templates to a host by including multiple, whitespace-delimited tokens in the HostMetadata field, each of which is associated with a respective Action, as in the following format:
This failed to map the target templates to the host.
I have tried wrapping the tokens in double quotes, as in the following example:
This has produced the same result (i.e. failure to associated target templates).
I have tried using the exact format presented in the examples in the documentation (see link above), as in the following example:
Amusingly, this resulted in an “invalid entry” error, the reason given being ‘not following “parameter=value” notation’. As an aside, this is a confusing inconsistency in the documentation and should probably be fixed.
Any insight or direction as to where in this process I’ve gone astray, or which of my assumptions are incorrect, would be greatly appreciated.
Code:
HostMetadata=<token> # <- no whitespace
Condition: host metadata like <token>
Operations:
- Add host
- Add to host groups: Test Group
- Add to host groups: Discovered hosts
- Link to Templates: <token-specific_template>
The documentation clearly suggests, by way of example, that Zabbix can parse multiple whitespace-delimited tokens (see “Active Agent Auto-registration, https://www.zabbix.com/documentation...o_registration). In practice, I have been unable to map multiple templates to a host by including multiple, whitespace-delimited tokens in the HostMetadata field, each of which is associated with a respective Action, as in the following format:
Code:
HostMetadata=<token1> <token2>
I have tried wrapping the tokens in double quotes, as in the following example:
Code:
HostMetadata=“<token1> <token2>”
I have tried using the exact format presented in the examples in the documentation (see link above), as in the following example:
Code:
HostMetadata: <token1> <token2>
Any insight or direction as to where in this process I’ve gone astray, or which of my assumptions are incorrect, would be greatly appreciated.
Comment