Skip to content

item prototype master item - No items with the name #1675

@aem-mechanikas

Description

@aem-mechanikas
SUMMARY

Unable to assign master item for item prototype using ansible, with GUI - I am able to do it.

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • community.zabbix.zabbix_itemprototype
ANSIBLE VERSION
ansible --version
ansible [core 2.19.4]
  config file = /home/gp/ansible/ansible.cfg
  configured module search path = ['/home/gp/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/gp/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Nov  6 2025, 13:44:16) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  pyyaml version = 6.0.1 (with libyaml v0.2.5)
CONFIGURATION
CONFIG_FILE() = /home/gp/ansible/ansible.cfg
DEFAULT_HOST_LIST(/home/gp/ansible/ansible.cfg) = ['/home/gp/ansible/inventories/prod/hosts']
DEFAULT_LOG_PATH(/home/gp/ansible/ansible.cfg) = /home/gp/ansible.log
DEFAULT_REMOTE_USER(/home/gp/ansible/ansible.cfg) = root
DEFAULT_ROLES_PATH(/home/gp/ansible/ansible.cfg) = ['/home/gp/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/gp/ansible/ansible.cfg) = debug
DEFAULT_TIMEOUT(/home/gp/ansible/ansible.cfg) = 20
DEFAULT_VAULT_PASSWORD_FILE(/home/gp/ansible/ansible.cfg) = /home/gp/vault.secret
DEPRECATION_WARNINGS(/home/gp/ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/home/gp/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/home/gp/ansible/ansible.cfg) = auto_silent
RETRY_FILES_ENABLED(/home/gp/ansible/ansible.cfg) = False
SYSTEM_WARNINGS(/home/gp/ansible/ansible.cfg) = False
OS / ENVIRONMENT / Zabbix Version
  • Ubuntu Server 24.04 LTS
STEPS TO REPRODUCE
  • Add non-LLD item as a master item to itemprototype using ansible
    # - name: "{% raw %}Create item prototype - Manual rate error JSON ({#ERROR_ID}){% endraw %}"
    #   community.zabbix.zabbix_itemprototype:
    #     name: "{% raw %}Manual rate error JSON ({#ERROR_ID}){% endraw %}"
    #     discoveryrule_name: "Manual rate error discovery"
    #     template_name: "WOW App"
    #     params:
    #       type: dependent_item
    #       key: "{% raw %}manual_rate_error.json[{#ERROR_ID}]{% endraw %}"
    #       value_type: text
    #       master_item:
    #         template_name: "WOW App"
    #         item_name: 'Manual exchange rate: error list (JSON)'
    #         discoveryrule_name: "Manual rate error discovery"
    #       preprocessing:
    #         - type: javascript
    #           params: |
    #             {% raw %}
    #             try {
    #                 var arr = JSON.parse(value);
    #                 var targetId = "{#ERROR_ID}";
    #                 for (var i = 0; i < arr.length; i++) {
    #                     if (arr[i].id == targetId) {
    #                         return JSON.stringify(arr[i]);
    #                     }
    #                 }
    #                 return "";
    #             } catch (e) {
    #                 return "";
    #             }
    #             {% endraw %}
    #           error_handler: zabbix_server
    #       tags:
    #         - tag: WOW
    #           value: application
    #     state: present
EXPECTED RESULTS
  • Non-lld master item assigned using ansible
ACTUAL RESULTS
  • error:
[ERROR]: Task failed: Module failed: No items with the name WOW App: Manual exchange rate: error list (JSON) exist to depend on
Origin: /home/gp/ansible/roles/zabbix-server/tasks/12_template_WOW.yml:99:7

97         state: present
98
99     - name: "{% raw %}Create item prototype - Manual rate error JSON ({#ERROR_ID}){% endraw %}"
         ^ column 7

fatal: [mon.x1mon.com]: FAILED! => {
    "changed": false
}

MSG:

No items with the name WOW App: Manual exchange rate: error list (JSON) exist to depend on

EDIT
Tested by trying to assign LLD item as master - works using Ansible.
Zabbix version 7.0.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions