Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete users from group if 'alldirusergroup' option isn't set. #55

Open
CompPhy opened this issue Nov 9, 2022 · 2 comments
Open

Comments

@CompPhy
Copy link

CompPhy commented Nov 9, 2022

We don't care about "audit" trail and left the alldirusergroup option out of our configuration. This causes an issue because there's a check against zabbix_alldirusergroup_users when looking for accounts to delete. In this case, it will never delete any users that no longer exist in the AD group. Which in turn causes other issues downsteam, for example then trying to do media sync.

Basically the error below is a downstream consequence, because the user doesn't exist in the LDAP group anymore but hasn't been removed prior to the media sync.

Traceback (most recent call last):
File "/var/lib/zabbix/zabbix-ldap-sync/zabbix-ldap-sync", line 115, in
main()
File "/var/lib/zabbix/zabbix-ldap-sync/zabbix-ldap-sync", line 111, in main
zabbix_conn.sync_users()
File "/data00/zabbix/zabbix-ldap-sync/lib/zabbixconn.py", line 590, in sync_users
if self.ldap_conn.get_user_media(ldap_users[each_user], self.ldap_media):
KeyError: 'cwalls'

I was able to work around this issue by commenting out lines 540 and 541 in lib/zabbixconn.py; see screen shot below. There's should probably be a better long term option, which is why I'm opening this issue. This at least allows me to automatically clean up deleted users as expected.

image

@scoopex
Copy link

scoopex commented Nov 10, 2022

Thanks for investigating and for creating the issue.
If you are capable to solve this problem, i invite you to contribute to this opensource project.
A submission will be very welcome and i will support you to get it ready for merging.

@CompPhy
Copy link
Author

CompPhy commented Nov 10, 2022

I made a PR, but I'm not sure how to connect it with this issue. I would like to do this myself if possible, do you have instructions for contributing somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants