zabbix-tooling / zabbix-ldap-sync

Sync Zabbix with LDAP directory server
BSD 3-Clause "New" or "Revised" License
50 stars 36 forks source link

ZabbixConn class not instantiated #26

Closed foreverdante closed 3 years ago

foreverdante commented 3 years ago

I've been working on getting our users inputted into Zabbix. However, whenever I run the script, the LDAPConn class fires, I'll paste the output below. What I can't figure out is after the zabbix-ldap-sync script is ran, it doesn't seem to get to the ZabbixConn part. I've already confirmed that I can successfully make API calls, the script queries LDAP.. But it just doesn't seem to make it to the point of actually creating the users in Zabbix.

Any help would be amazing!

Thanks!

LDAPConn output:

2021-01-27 15:36:09,563 - LDAPConn - DEBUG - Searching LDAP with filter >>>(&(&(objectClass=user)(sAMAccountName=%s)))<<<
ldap_search_ext
put_filter: "(&(&(objectClass=user)(sAMAccountName=%s)))"
put_filter: AND
put_filter_list "(&(objectClass=user)(sAMAccountName=%s))"
put_filter: "(&(objectClass=user)(sAMAccountName=%s))"
put_filter: AND
put_filter_list "(objectClass=user)(sAMAccountName=%s)"
put_filter: "(objectClass=user)"
put_filter: simple
put_simple_filter: "objectClass=user"
put_filter: "(sAMAccountName=%s)"
put_filter: simple
put_simple_filter: "sAMAccountName=%s"
ldap_build_search_req ATTRS: sAMAccountName
ldap_send_initial_request
ldap_send_server_request
ldap_result ld 0x55a7da0307d0 msgid 47
wait4msg ld 0x55a7da0307d0 msgid 47 (infinite timeout)
wait4msg continue ld 0x55a7da0307d0 msgid 47 all 1
** ld 0x55a7da0307d0 Connections:
* host: $(ldapserver).$(domain).com  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Wed Jan 27 15:36:09 2021

** ld 0x55a7da0307d0 Outstanding Requests:
 * msgid 47,  origid 47, status InProgress
   outstanding referrals 0, parent count 0
  ld 0x55a7da0307d0 request count 1 (abandoned 0)
** ld 0x55a7da0307d0 Response Queue:
   Empty
  ld 0x55a7da0307d0 response count 0
ldap_chkResponseList ld 0x55a7da0307d0 msgid 47 all 1
ldap_chkResponseList returns ld 0x55a7da0307d0 NULL
ldap_int_select
read1msg: ld 0x55a7da0307d0 msgid 47 all 1
read1msg: ld 0x55a7da0307d0 msgid 47 message type search-result
read1msg: ld 0x55a7da0307d0 0 new referrals
read1msg:  mark request completed, ld 0x55a7da0307d0 msgid 47
request done: ld 0x55a7da0307d0 msgid 47
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 47, msgid 47)
ldap_parse_result
ldap_msgfree
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed

API Connection:

2021-01-27 15:38:32,513 - pyzabbix - DEBUG - Sending: {
    "jsonrpc": "2.0",
    "method": "usergroup.get",
    "params": {
        "status": 0,
        "output": "extend"
    },
    "id": 2,
    "auth": "0994ff5fcd5eb4350fa1973319ac5c6a"
}
scoopex commented 3 years ago

Do you still experience this problem. Did you find the reason for it? Please reopen if it still exists.