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 tag support for zabbix_group_events_info module #1446

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

Conversation

aplathrop
Copy link
Contributor

SUMMARY

Adds support to the zabbix_group_events_info module to filter events by tag. It also adds the tags returned by last_event

This is similar to what I did for the zabbix_host_events_info (see: #1258)

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • zabbix_group_events_info
ADDITIONAL INFORMATION

Being able to filter events by tag is supported by the Zabbix API, but not the current zabbix_group_events_info module, so I've added support for it. An example of this can be seen below:

- community.zabbix.zabbix_group_events_info:
    hostgroup_name: ExampleGroup
    trigger_severity: warning
    tags:
      - tag: ExampleTag
        value: ExampleValue
        operator: equal

I believe it would also be useful to do the inverse, get a list of events for a host group and then be able to do something based on the tags the events return:

- community.zabbix.zabbix_group_events_info:
    hostgroup_name: ExampleGroup
    trigger_severity: warning
  register: zabbix_group_events_tags

- ansible.builtin.debug:
    msg: "{{ zabbix_group_events_tags.triggers_problem[0].last_event.tags }}"

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.42%. Comparing base (a0f5d37) to head (ab3a275).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
+ Coverage   78.40%   78.42%   +0.02%     
==========================================
  Files          47       47              
  Lines        5848     5855       +7     
  Branches     1491     1494       +3     
==========================================
+ Hits         4585     4592       +7     
  Misses        780      780              
  Partials      483      483              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aplathrop aplathrop marked this pull request as ready for review January 21, 2025 18:06
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