Skip to content

Include macro filtering for hosts #1921

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ozarrouki
Copy link

@ozarrouki ozarrouki commented Nov 25, 2024

Summary:

Support for Query Types: Added support for querying user macro names and user macro values.
Filtering Hosts: Implemented the ability to filter hosts in Zabbix using user macro names and values.
Regex Filtering: Enhanced filtering capabilities by adding support for regular expression (regex) filtering on user macro names and values.
These changes aim to improve the flexibility and precision of host filtering in Zabbix, making it easier to manage and visualize data in Grafana.

Changes:

Added query types for user macro names and values.
Implemented filtering logic for hosts based on user macros.
Added regex support for user macro filtering in Variable settings.

Screeshots:

image

image

image

image

Fixes #1926

@ozarrouki ozarrouki requested a review from a team as a code owner November 25, 2024 17:07
@CLAassistant
Copy link

CLAassistant commented Nov 25, 2024

CLA assistant check
All committers have signed the CLA.

@zoltanbedi
Copy link
Member

Can you please open an issue for this first where you describe the problem that you are trying to solve?

@ozarrouki
Copy link
Author

Hello

here is the linked issue to this request :
#1926

@zoltanbedi
Copy link
Member

Also you need to accept the CLA.

@ozarrouki ozarrouki force-pushed the include-macro-filtering-for-hosts branch from e196872 to 4fb5863 Compare December 10, 2024 14:41
docs/make-docs Outdated
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files show as modifed when they were not i added a space to see the contents

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files show as modifed when they were not i added a space to see the contents

debug-backend.sh Outdated
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files show as modifed when they were not i added a space to see the contents

@krisavi
Copy link
Contributor

krisavi commented Mar 6, 2025

src/datasource/zabbix/zabbix.ts L213 that extra 'n' before comment seems not good.

Copy link
Member

@zoltanbedi zoltanbedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the code again but I'd like to have a better understanding on what we want to achieve here before we go into implementation details.

@@ -245,6 +254,15 @@ export class ZabbixAPIConnector {
return this.request('usermacro.get', params);
}

getMacrosByGroup(groupids) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the need for 2 different functions. The other one only misses 3 fields.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why don't you use the getMacros function above and extend that with the groupids?

@zoltanbedi
Copy link
Member

Also it would be best to try to create smaller PRs that only focus on one aspect at a time. It would help us reviewing the code faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

filtering hosts variable using user macros
5 participants