-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add host property tagging #67
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.