{"action":"opened","issue":{"url":"https://api.github.com/repos/dnaeon/zabbix-ldap-sync/issues/47","repository_url":"https://api.github.com/repos/dnaeon/zabbix-ldap-sync","labels_url":"https://api.github.com/repos/dnaeon/zabbix-ldap-sync/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/dnaeon/zabbix-ldap-sync/issues/47/comments","events_url":"https://api.github.com/repos/dnaeon/zabbix-ldap-sync/issues/47/events","html_url":"https://github.com/dnaeon/zabbix-ldap-sync/issues/47","id":197963279,"number":47,"title":"Cannot connect to LDAP server error","user":{"login":"SKUZ-ee","id":23202704,"avatar_url":"https://avatars.githubusercontent.com/u/23202704?v=3","gravatar_id":"","url":"https://api.github.com/users/SKUZ-ee","html_url":"https://github.com/SKUZ-ee","followers_url":"https://api.github.com/users/SKUZ-ee/followers","following_url":"https://api.github.com/users/SKUZ-ee/following{/other_user}","gists_url":"https://api.github.com/users/SKUZ-ee/gists{/gist_id}","starred_url":"https://api.github.com/users/SKUZ-ee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SKUZ-ee/subscriptions","organizations_url":"https://api.github.com/users/SKUZ-ee/orgs","repos_url":"https://api.github.com/users/SKUZ-ee/repos","events_url":"https://api.github.com/users/SKUZ-ee/events{/privacy}","received_events_url":"https://api.github.com/users/SKUZ-ee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-29T07:03:55Z","updated_at":"2016-12-29T07:03:55Z","closed_at":null,"body":"I have been trying to get this script to sync Zabbix with Active Directory and can't seem to get it to work. It successfully creates the group but it does not populate the created group with any members of the specified AD group. Here is the error that I keep getting.\r\n\r\nError:\r\nCannot connect to LDAP server: {'info': 'Error in the pull function.', 'desc': \"Can't contact LDAP server\"}\r\n\r\n- LDAP authentication is working with Zabbix\r\n- ldapsearch can successfully query AD names\r\n\r\nCan you please help me and see what I am doing wrong?\r\n\r\n===============\r\nzabbix-ldap-users.conf\r\n[ldap]\r\ntype = activedirectory\r\nuri = ldaps://192.168.1.102:389/\r\nbase = OU=User Accounts,DC=ad,DC=home,DC=lan\r\nbinduser = ad\\zabbixuser\r\nbindpass = password123\r\ngroups = Zabbix_Users\r\n\r\n[ad]\r\nfiltergroup = (&(objectClass=group)(name=%s))\r\nfilteruser = (objectClass=user)(objectCategory=Person)\r\nfilterdisabled = (!(userAccountControl:1.2.840.113556.1.4.803:=2))\r\nfiltermemberof = (memberOf:1.2.840.113556.1.4.1941:=%s)\r\ngroupattribute = member\r\nuserattribute = sAMAccountName\r\n\r\n[openldap]\r\ntype = posix\r\nfiltergroup = (&(objectClass=posixGroup)(cn=%s))\r\nfilteruser = (&(objectClass=posixAccount)(uid=%s))\r\ngroupattribute = memberUid\r\nuserattribute = uid\r\n\r\n[zabbix]\r\nserver = http://192.168.1.114/zabbix/\r\nusername = zabbixuser\r\npassword = password123\r\n\r\n[user]\r\ntype = 1\r\n\r\n[media]\r\ndescription = Email\r\n\r\n==========\r\nverbose output:\r\nroot@zabbix:/opt/zabbix-ldap-sync# ./zabbix-ldap-sync -f zabbix-ldap-users.conf --verbose\r\n2016-12-29 01:57:13,494 - INFO - JSON-RPC Server Endpoint: http://192.168.1.114/zabbix//api_jsonrpc.php\r\n2016-12-29 01:57:13,494 - INFO - JSON-RPC Server Endpoint: http://192.168.1.114/zabbix//api_jsonrpc.php\r\n2016-12-29 01:57:13,495 - DEBUG - Sending: {\r\n    \"params\": {\r\n        \"password\": \"password123\",\r\n        \"user\": \"zabbixuser\"\r\n    },\r\n    \"jsonrpc\": \"2.0\",\r\n    \"method\": \"user.login\",\r\n    \"id\": 0\r\n}\r\n2016-12-29 01:57:13,495 - DEBUG - Sending: {\r\n    \"params\": {\r\n        \"password\": \"password123\",\r\n        \"user\": \"zabbixuser\"\r\n    },\r\n    \"jsonrpc\": \"2.0\",\r\n    \"method\": \"user.login\",\r\n    \"id\": 0\r\n}\r\n2016-12-29 01:57:13,498 - DEBUG - Starting new HTTP connection (1): 192.168.1.114\r\n2016-12-29 01:57:13,733 - DEBUG - http://192.168.1.114:80 \"POST /zabbix//api_jsonrpc.php HTTP/1.1\" 200 68\r\n2016-12-29 01:57:13,735 - DEBUG - Response Code: 200\r\n2016-12-29 01:57:13,735 - DEBUG - Response Code: 200\r\n2016-12-29 01:57:13,747 - DEBUG - Response Body: {\r\n    \"jsonrpc\": \"2.0\",\r\n    \"result\": \"ca9dc2ca0d3a06289506c1eaa7a1ca76\",\r\n    \"id\": 0\r\n}\r\n2016-12-29 01:57:13,747 - DEBUG - Response Body: {\r\n    \"jsonrpc\": \"2.0\",\r\n    \"result\": \"ca9dc2ca0d3a06289506c1eaa7a1ca76\",\r\n    \"id\": 0\r\n}\r\n2016-12-29 01:57:13,748 - DEBUG - Sending: {\r\n    \"params\": {\r\n        \"status\": 0,\r\n        \"output\": \"extend\"\r\n    },\r\n    \"jsonrpc\": \"2.0\",\r\n    \"method\": \"usergroup.get\",\r\n    \"auth\": \"ca9dc2ca0d3a06289506c1eaa7a1ca76\",\r\n    \"id\": 1\r\n}\r\n2016-12-29 01:57:13,748 - DEBUG - Sending: {\r\n    \"params\": {\r\n        \"status\": 0,\r\n        \"output\": \"extend\"\r\n    },\r\n    \"jsonrpc\": \"2.0\",\r\n    \"method\": \"usergroup.get\",\r\n    \"auth\": \"ca9dc2ca0d3a06289506c1eaa7a1ca76\",\r\n    \"id\": 1\r\n}\r\n2016-12-29 01:57:13,759 - DEBUG - http://192.168.1.114:80 \"POST /zabbix//api_jsonrpc.php HTTP/1.1\" 200 431\r\n2016-12-29 01:57:13,760 - DEBUG - Response Code: 200\r\n2016-12-29 01:57:13,760 - DEBUG - Response Code: 200\r\n2016-12-29 01:57:13,761 - DEBUG - Response Body: {\r\n    \"jsonrpc\": \"2.0\",\r\n    \"result\": [\r\n        {\r\n            \"usrgrpid\": \"7\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"1\",\r\n            \"name\": \"Zabbix administrators\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"11\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"1\",\r\n            \"name\": \"Enabled debug mode\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"12\",\r\n            \"gui_access\": \"2\",\r\n            \"debug_mode\": \"0\",\r\n            \"name\": \"No access to the frontend\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"25\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"0\",\r\n            \"name\": \"NMS_Users\",\r\n            \"users_status\": \"0\"\r\n        }\r\n    ],\r\n    \"id\": 1\r\n}\r\n2016-12-29 01:57:13,761 - DEBUG - Response Body: {\r\n    \"jsonrpc\": \"2.0\",\r\n    \"result\": [\r\n        {\r\n            \"usrgrpid\": \"7\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"1\",\r\n            \"name\": \"Zabbix administrators\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"11\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"1\",\r\n            \"name\": \"Enabled debug mode\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"12\",\r\n            \"gui_access\": \"2\",\r\n            \"debug_mode\": \"0\",\r\n            \"name\": \"No access to the frontend\",\r\n            \"users_status\": \"0\"\r\n        },\r\n        {\r\n            \"usrgrpid\": \"25\",\r\n            \"gui_access\": \"0\",\r\n            \"debug_mode\": \"0\",\r\n            \"name\": \"NMS_Users\",\r\n            \"users_status\": \"0\"\r\n        }\r\n    ],\r\n    \"id\": 1\r\n}\r\nCannot connect to LDAP server: {'info': 'Error in the pull function.', 'desc': \"Can't contact LDAP server\"}\r\n"}}
{"actor":{"display_login":"SKUZ-ee"}}