salt.states.zabbix_action

New in version 2017.7.

Management of Zabbix Action object over Zabbix API.

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

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.zabbix_action.html