Open
Description
SUMMARY
Add support for specifying master item parameter to zabbix_discoveryrule.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
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