Skip to content

Add support for master_itemid and lld_macro_path parameter to zabbix_discoveryrule #1464

Open
@osten33

Description

@osten33
SUMMARY

Add support for specifying master item parameter to zabbix_discoveryrule.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

zabbix_discoveryrule

ADDITIONAL INFORMATION

Currently, there is no way to create a dependent type discovery rule with the module as the master item is not a supported parameter.

  - name: Certificates discovery rule
    community.zabbix.zabbix_discoveryrule:
      name: Certificates discovery
      template_name: Template SSL Certificates
      params:
        type: dependent_item
        key: certificates.discovery
        interval: 0
        lifetime: 3d
        enabled_lifetime_type: 1
        status: enabled
      master_itemid:
        item_name: cert.raw
        template_name: Template SSL Certificates
      state: present

Error:

fatal: [zabbix]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (community.zabbix.zabbix_discoveryrule) module: master_itemid. Supported parameters include: host_name, http_login_password, http_login_user, name, params, state, template_name."}

And without master_itemid at all in task the API returns error that it is required:

fatal: [zabbix]: FAILED! => {"changed": false, "msg": "connection error occurred: REST API returned {'code': -32602, 'message': 'Invalid params.', 'data': 'Invalid parameter \"/1\": the parameter \"master_itemid\" is missing.'} when sending {\"jsonrpc\": \"2.0\", \"method\": \"discoveryrule.create\", \"id\": \"<omitted>\", \"params\": {\"type\": 18, \"lifetime\": \"3d\", \"enabled_lifetime_type\": 1, \"status\": 0, \"name\": \"Certificates discovery\", \"key_\": \"certificates.discovery\", \"delay\": 0, \"hostid\": \"10123\"}, \"auth\": \"<omitted>"}"}

The same issue seems to exist for LLD macro path.

https://www.zabbix.com/documentation/current/en/manual/api/reference/discoveryrule/object

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmoduleThe issue or pull request is related to Zabbix module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions