Documentation

zabbix_hostmacro - Zabbix host macro creates/updates/deletes

New in version 2.0.

Synopsis

  • manages Zabbix host macros, it can create, update or delete them.

Options

parameter required default choices comments
host_name
yes
Name of the host.
http_login_password
(added in 2.1)
no None
Basic Auth password
http_login_user
(added in 2.1)
no None
Basic Auth login
login_password
yes
Zabbix user password.
login_user
yes
Zabbix user name.
macro_name
yes
Name of the host macro.
macro_value
yes
Value of the host macro.
server_url
yes
Url of Zabbix server, with protocol (http or https).

aliases: url
state
no present
  • present
  • absent
State of the macro.
On present, it will create if macro does not exist or update the macro if the associated data is different.
On absent will remove a macro if it exists.
timeout
no 10
The timeout of API request (seconds).

Examples

- name: Create a new host macro or update an existing macro's value
  local_action:
    module: zabbix_hostmacro
    server_url: http://monitor.example.com
    login_user: username
    login_password: password
    host_name: ExampleHost
    macro_name: Example macro
    macro_value: Example value
    state: present

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.