zabbix-tooling / zabbix-ldap-sync

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

Problem with Zabbix 6.4 #59

Open Skifi opened 1 year ago

Skifi commented 1 year ago

Hello, I am using your script on Zabbix server 6.4. I found problem with API change: https://support.zabbix.com/browse/ZBX-17955 In update media function there needs to be version check. I am not programmer but this works for me:

if self.get_api_minor_version() >= 5.2: result = self.conn.user.update(userid=str(userid), medias=[media_defaults]) if self.get_api_minor_version() > 3.2 and self.get_api_minor_version() < 5.2: result = self.conn.user.update(userid=str(userid), user_medias=[media_defaults]) else: self.delete_media_by_description(user, description) result = self.conn.user.updatemedia(users=[{"userid": str(userid)}], medias=media_defaults)

I have tested this on 6.4 and 6.2.9. Please implement this.

scoopex commented 1 year ago

Thanks for reporting, pull requests and contribution are always welcome. I made the suggested change, can you test my change?