-
Problem report
-
Resolution: Duplicate
-
Trivial
-
None
-
4.4.2rc2
-
None
-
None
Steps to reproduce:
- Create a python script to configure ldap parameter (see code sample below)
- Check error message
Result:
{'code': -32602, 'message': 'Invalid params.', 'data': 'Incorrect API "authentication".', 'json': "{'jsonrpc': '2.0', 'method': 'authentication.edit', 'params': {'action': 'authentication.update', 'authentication_type': 1, 'http_auth_enabled': 0, 'ldap_configured': 1, 'ldap_host': 'ldaps://our_ldap_server.org.ca', 'ldap_port': '636', 'ldap_base_dn': 'DC=our,DC=ldap,DC=server,DC=org', 'ldap_search_attribute': 'sAMAccountName', 'ldap_bind_dn': 'CN=our.binduser,OU=Our Users,OU=Our,OU=Business Units,DC=our,DC=ldap,DC=server,DC=org', 'ldap_bind_password': 'our_bind_password', 'change_bind_password': 1, 'ldap_case_sensitive': 1, 'action_passw_change': 'authentication.edit', 'ldap_test_user': 'A_user', 'ldap_test_password': 'a_password', 'ldap_test': 1}, 'id': '1', 'auth': '35fa341dab13be0958d741b3db90184d'}"}
Expected:
See screenshots from ZABBIX GUI POST call, same action name, same params name and this one is working
code sample:
from pyzabbix import ZabbixAPI, ZabbixAPIException zapi = ZabbixAPI(url=10.55.0.24, user='Admin', password='zabbix') ldap_config = { 'action': 'authentication.update', 'authentication_type': 1, 'http_auth_enabled': 0, 'ldap_configured': 1, 'ldap_host': 'ldaps://our_ldap_server.org.ca', 'ldap_port': 636, 'ldap_base_dn': 'DC=our,DC=ldap,DC=server,DC=org', 'ldap_search_attribute': 'sAMAccountName', 'ldap_bind_dn': "CN=our.binduser,OU=Our Users,OU=Our,OU=Business Units,DC=our,DC=ldap,DC=server,DC=org", 'ldap_bind_password': "our_bind_password', 'change_bind_password': 1, 'ldap_case_sensitive': 1, 'action_passw_change': 'authentication.edit', 'ldap_test_user': A_user, 'ldap_test_password': a_password, 'ldap_test': 1 } try: zapi.do_request('authentication.edit', ldap_config) except ZabbixAPIException as e: print(e)
- is duplicated by
-
ZBXNEXT-5673 API method for global configuration changes
- Open