This PR adds the ability to automatically tag hosts with their source properties. The name of the tag and the properties to include are configurable with the following new configuration options:
[zabbix.property_tagging]
enabled = true
tag = "property"
include = []
exclude = []
The options include & exclude accept regular expressions which will be used to filter which properties are used for tagging. If no patterns are included, all properties are used.
The property tags are fully managed by ZAC, which means that if a source host loses a property, the corresponding property tag will also be removed in Zabbix.*
How it works
Given a host with the properties is_adfs_server and is_app_server , and the following configuration:
If a host has a property called broken_server and we want to exclude it from being used as a tag, we can configure it like this:
exclude = ["broken_server"]
If we want to exclude all properties starting with broken_, we can add a wildcard pattern:
exclude = ["broken_.*"]
Or if we only want to include properties that follow the is_<type>_server pattern, we can use an include pattern:
include = ["is_.*_server"]
We can also combine include and exclude patterns to create more advanced filters:
include = ["is_.*_server"]
exclude = ["is_broken_server", "is_bad_server"]
*Whether or not a DB host can actually lose a property in practice is another question entirely though. I believe SourceMergerProcess.merge_hosts & Host.merge are not fully capable of determining when a host has had data removed; they can only add new data. That should be fixed in a future PR.
This PR adds the ability to automatically tag hosts with their source properties. The name of the tag and the properties to include are configurable with the following new configuration options:
The options
include
&exclude
accept regular expressions which will be used to filter which properties are used for tagging. If no patterns are included, all properties are used.The property tags are fully managed by ZAC, which means that if a source host loses a property, the corresponding property tag will also be removed in Zabbix.*
How it works
Given a host with the properties
is_adfs_server
andis_app_server
, and the following configuration:The host is given the following tags:
Including and excluding tags
If a host has a property called
broken_server
and we want to exclude it from being used as a tag, we can configure it like this:If we want to exclude all properties starting with
broken_
, we can add a wildcard pattern:Or if we only want to include properties that follow the
is_<type>_server
pattern, we can use an include pattern:We can also combine include and exclude patterns to create more advanced filters:
*Whether or not a DB host can actually lose a property in practice is another question entirely though. I believe
SourceMergerProcess.merge_hosts
&Host.merge
are not fully capable of determining when a host has had data removed; they can only add new data. That should be fixed in a future PR.