ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
315 stars 265 forks source link

Add Module to Update Host Events #1238

Closed aplathrop closed 1 month ago

aplathrop commented 1 month ago
SUMMARY

Add module that leverages the event.acknowledge API method

ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION

I wanted to be able to update events using the API, but the module did not exist, so I created it. It works well with the zabbix_host_events_info module, one can use that to get events for a host and then take the output from that module to update the event

- name: get events for host
  community.zabbix.zabbix_host_events_info:
    host_identifier: ExampleHost
    host_id_type: hostname
    trigger_severity: warning
  register: zabbix_host_events

- name: acknowledge event
  community.zabbix.zabbix_host_events_update:
    params:
      eventids: "{{ zabbix_host_events.triggers_problem[0].last_event.eventid }}"
      action: ack
      msg: "event acknowledged"
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.59%. Comparing base (0a689a5) to head (42f9e4b). Report is 39 commits behind head on main.

:exclamation: Current head 42f9e4b differs from pull request most recent head 00a669e

Please upload reports for the commit 00a669e to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1238 +/- ## ========================================== - Coverage 79.57% 77.59% -1.99% ========================================== Files 35 36 +1 Lines 4435 4458 +23 Branches 1166 1165 -1 ========================================== - Hits 3529 3459 -70 - Misses 535 621 +86 - Partials 371 378 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pyrodie18 commented 1 month ago

Nice work and thanks for the addition