salt.states.zabbix_action

Warning

This module will be removed from Salt in version 3009 in favor of the zabbix Salt Extension.

Management of Zabbix Action object over Zabbix API.

New in version 2017.7.0.

codeauthor:

Jakub Sliva <jakub.sliva@ultimum.io>

salt.states.zabbix_action.absent(name, **kwargs)

Makes the Zabbix Action to be absent (either does not exist or delete it).

Parameters:
  • name -- Zabbix Action name

  • _connection_user -- Optional - zabbix user (can also be set in opts or pillar, see module's docstring)

  • _connection_password -- Optional - zabbix password (can also be set in opts or pillar, see module's docstring)

  • _connection_url -- Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

zabbix-action-absent:
    zabbix_action.absent:
        - name: Action name
salt.states.zabbix_action.present(name, params, **kwargs)

Creates Zabbix Action object or if differs update it according defined parameters

Parameters:
  • name -- Zabbix Action name

  • params -- Definition of the Zabbix Action

  • _connection_user -- Optional - zabbix user (can also be set in opts or pillar, see module's docstring)

  • _connection_password -- Optional - zabbix password (can also be set in opts or pillar, see module's docstring)

  • _connection_url -- Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

If there is a need to get a value from current zabbix online (e.g. id of a hostgroup you want to put a discovered system into), put a dictionary with two keys "query_object" and "query_name" instead of the value. In this example we want to get object id of hostgroup named "Virtual machines" and "Databases".

zabbix-action-present:
    zabbix_action.present:
        - name: VMs
        - params:
            eventsource: 2
            status: 0
            filter:
                evaltype: 2
                conditions:
                    - conditiontype: 24
                      operator: 2
                      value: 'virtual'
                    - conditiontype: 24
                      operator: 2
                      value: 'kvm'
            operations:
                - operationtype: 2
                - operationtype: 4
                  opgroup:
                      - groupid:
                          query_object: hostgroup
                          query_name: Virtual machines
                      - groupid:
                          query_object: hostgroup
                          query_name: Databases