-
Incident report
-
Resolution: Duplicate
-
Minor
-
None
-
7.0.0
-
None
I’ve created a python script, to replicate this issue:
#!/usr/bin/env python3 import json, requests # Functions def zabbixApi(method, params): response = requests.post('https://localhost/api_jsonrpc.php', verify=False, headers={'Content-Type': 'application/json-rpc'}, json={ 'jsonrpc': '2.0', 'auth': 'redacted', 'id': 'id', 'method': method, 'params': params, }) response.raise_for_status() if 'error' in response.json(): raise Exception('Zabbix error (%s)' % response.json()['error']) if response.json()['id'] != 'id': raise Exception('Invalid result') return response.json()['result'] # Main if __name__ != '__main__': raise Exception('Not meant to be run as a module.') requests.packages.urllib3.disable_warnings(category=requests.packages.urllib3.exceptions.InsecureRequestWarning) zabbixApi('host.create', [{ 'host': 'test host '+str(i), 'tags': [ { 'tag': 'imported', 'value': 'yes' } ], 'groups': [ { 'groupid': '32' } ], 'templates': [ { 'templateid': '10351' } ], 'tls_connect': 2, 'tls_accept': 2, 'tls_psk_identity': 'test', 'tls_psk': 'redacted', } for i in list(range(300))])
When i run it, i get errors like this:
capmon@docker01 ~ $ ./bugtest.py Traceback (most recent call last): File "/home/capmon/./bugtest.py", line 32, in <module> zabbixApi('host.create', [{ File "/home/capmon/./bugtest.py", line 18, in zabbixApi if 'error' in response.json(): raise Exception('Zabbix error (%s)' % response.json()['error']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Exception: Zabbix error ({'code': -32602, 'message': 'Invalid params.', 'data': 'Cannot inherit item with key "vm.memory.size[used]" of template "Windows by Zabbix agent active" to host "test host 100", because an item with the same key is already inherited from template "Windows by Zabbix agent active".'})
If i only add 100 hosts it works.
- duplicates
-
ZBX-24622 Impossible to perform many hosts mass update
- Closed