Skip to content
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
wants to merge 19 commits into from

Conversation

pederhan
Copy link
Member

@pederhan pederhan commented Nov 2, 2023

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:

[zabbix]
tags_prefix = "zac_"

[zabbix.property_tagging]
enabled = true
tag = "property"

The host is given the following tags:

image

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:

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.

@pederhan pederhan marked this pull request as draft November 8, 2023 10:08
@pederhan
Copy link
Member Author

pederhan commented Sep 3, 2024

Closing. #81 obsoletes a lot of code in this PR. Can revisit in the future.

@pederhan pederhan closed this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant