zabbix-tooling / zabbix-ldap-sync

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

Add option to trim full DN #60

Open GOID1989 opened 1 year ago

GOID1989 commented 1 year ago

Hi! We using FreeIPA as LDAP Auth Service. With that line we facing with problem when memberid contains full DN to account https://github.com/zabbix-tooling/zabbix-ldap-sync/blob/bcb898d95850603423c312255439251b1fa82489/lib/ldapconn.py#L112

For quick hack

memberid = memberid.decode("utf-8")
memberid = memberid.split(',')[0]

Config is

[openldap]
type = posix
filtergroup = (&(objectClass=posixGroup)(cn=%s))
filteruser = (&(objectClass=posixAccount)(%s))
groupattribute = member
userattribute = uid

Maybe add some option to choose cut or not ?

scoopex commented 1 year ago

Thanks for investigating. Probably its a good idea to have a ldap-server-flavour toggle in zabbix-ldap-sync to enable transformations like this.

We are very happy to receive contributions from users who actually use the tool. Would you like to try it out?