community.zabbix.zabbix_host_events_update module – update the status of event(s).

Note

This module is part of the community.zabbix collection (version 3.2.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.zabbix. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.zabbix.zabbix_host_events_update.

Synopsis

  • Updates the status of event(s).

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6

Parameters

Parameter

Comments

http_login_password

string

Basic Auth password

http_login_user

string

Basic Auth login

params

dictionary / required

Parameters to update event(s) with.

Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/event/acknowledge

Additionally supported parameters are below

action

string

action to update the event with

Overrides “action” in API docs

Required when actions is not used.

Mutually exclusive with actions.

Choices:

  • "close_problem"

  • "close"

  • "acknowledge_event"

  • "acknowledge"

  • "ack"

  • "add_message"

  • "message"

  • "msg"

  • "change_severity"

  • "severity"

  • "unacknowledge_event"

  • "unacknowledge"

  • "unack"

  • "suppress_event"

  • "suppress"

  • "unsuppress_event"

  • "unsuppress"

  • "change_event_rank_to_cause"

  • "convert_to_cause"

  • "change_event_rank_to_symptom"

  • "convert_to_symptom"

actions

list / elements=string

actions to update the event with

Overrides “action” in API docs

Required when action is not used.

Mutually exclusive with action.

Choices:

  • "close_problem"

  • "close"

  • "acknowledge_event"

  • "acknowledge"

  • "ack"

  • "add_message"

  • "message"

  • "msg"

  • "change_severity"

  • "severity"

  • "unacknowledge_event"

  • "unacknowledge"

  • "unack"

  • "suppress_event"

  • "suppress"

  • "unsuppress_event"

  • "unsuppress"

  • "change_event_rank_to_cause"

  • "convert_to_cause"

  • "change_event_rank_to_symptom"

  • "convert_to_symptom"

msg

string

Text of the message.

Alias for “message” in API docs

severity

string

New severity for events.

Overrides “severity” in API docs

Choices:

  • "not_classified"

  • "information"

  • "warning"

  • "average"

  • "high"

  • "disaster"

Examples

# If you want to use Username and Password to be authenticated by Zabbix Server
- name: Set credentials to access Zabbix Server API
  ansible.builtin.set_fact:
    ansible_user: Admin
    ansible_httpapi_pass: zabbix

# If you want to use API token to be authenticated by Zabbix Server
# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
- name: Set API token
  ansible.builtin.set_fact:
    ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895

# Acknowledge single event
- name: ack event
  community.zabbix.zabbix_host_events_update:
    params:
      eventids: 12345
      actions: ack

- name: ack and close event with a message
  community.zabbix.zabbix_host_events_update:
    params:
      eventids: [12345, 67890]
      actions: ['ack', 'msg', 'close']
      msg: 'closed by user'

Authors

  • Andrew Lathrop (@aplathrop)