ansible-collections / community.zabbix

Zabbix Ansible modules

Home Page:http://galaxy.ansible.com/community/zabbix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to create template and group items by application?

djdejawu opened this issue · comments

I'm want to find out - how is it possible to do?
I've got a task:

      community.zabbix.zabbix_template:
        # template_json: "{{ lookup('file', 'zbx_tmpl_aaaa_core.json') }}"
        state: present
        template_json:
          zabbix_export:
            version: "5.0"
            templates:
              - name: Status
                # applications:
                #   - name: Status
                template: AAAA_CORE
                groups:
                  - name: AAAA_CORE
              - name: AAAA_CORE
                # applications:
                #   - name: Status
                groups:
                  - name: AAAA_CORE
                template: AAAA_CORE
                items:
                  - name: Device status
                    # applications:
                    #   - name: Status
                    key: state_code
...

When I'm give this values applications into API it's response me:
connection error occurred: REST API returned {'code': -32500, 'message': 'Application error.', 'data': 'Item \"Device status\" on \"AAAA_CORE\": application \"Status\" does not exist.'} when sending ...

When I'm importing JSON file, I've got the same error.
Maybe it's possible to do in two steps?