Compare commits
2 Commits
8d2aaad188
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adb76f06f9 | ||
|
|
f9f4ba504e |
@@ -7,6 +7,7 @@ This is a pure bash-script for syncing a Actice-Directory Group via LDAP with a
|
|||||||
- 2020-05-05 **V1.1b** => add ldapsearch parameter `-o ldif-wrap=no` to prevent line breaks after 79 chars
|
- 2020-05-05 **V1.1b** => add ldapsearch parameter `-o ldif-wrap=no` to prevent line breaks after 79 chars
|
||||||
- 2020-08-06 **V1.1c** => add more debbuging for -v when a new user is created (show the full curl command)
|
- 2020-08-06 **V1.1c** => add more debbuging for -v when a new user is created (show the full curl command)
|
||||||
- 2021-01-10 **V1.2** => add support for Zabbix 5.2 or higher (breaking changes in API) with API-Version check bultin
|
- 2021-01-10 **V1.2** => add support for Zabbix 5.2 or higher (breaking changes in API) with API-Version check bultin
|
||||||
|
- 2021-02-06 **v1.3.1** => fixed error when user moved to disabled group
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -20,6 +21,7 @@ This is a pure bash-script for syncing a Actice-Directory Group via LDAP with a
|
|||||||
- from Zabbix 5.2.x using the User Role (roleid)
|
- from Zabbix 5.2.x using the User Role (roleid)
|
||||||
- Disable users in Zabbix which are removed from Group
|
- Disable users in Zabbix which are removed from Group
|
||||||
- user- or group names with spaces are no problem
|
- user- or group names with spaces are no problem
|
||||||
|
- verbose mode for debugging including curl commands
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
### 1. Prepare Active Directory
|
### 1. Prepare Active Directory
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#############################################################################################################
|
#############################################################################################################
|
||||||
# Script Name ...: zabbix-ldap-sync.sh
|
# Script Name ...: zabbix-ldap-sync.sh
|
||||||
# Version .......: V1.3
|
# Version .......: V1.3.1
|
||||||
# Date ..........: 10.01.2021
|
# Date ..........: 06.02.2021
|
||||||
# Description....: Synchronise Members of a Actice Directory Group with Zabbix via API
|
# Description....: Synchronise Members of a Actice Directory Group with Zabbix via API
|
||||||
# User wich are removed will be deactivated
|
# User wich are removed will be deactivated
|
||||||
# Args ..........:
|
# Args ..........:
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
# Email Private : Bernhard@znil.de
|
# Email Private : Bernhard@znil.de
|
||||||
#############################################################################################################
|
#############################################################################################################
|
||||||
# Variables
|
# Variables
|
||||||
Script_Version="V1.2 (2021-01-10)"
|
Script_Version="V1.3.1 (2021-02-06)"
|
||||||
# Colors for printf and echo
|
# Colors for printf and echo
|
||||||
DEFAULT_FOREGROUND=39
|
DEFAULT_FOREGROUND=39
|
||||||
RED=31
|
RED=31
|
||||||
@@ -1294,7 +1294,8 @@ if [ "$b_Must_Sync_Users" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
tempvar=""
|
tempvar=""
|
||||||
# maybe the list is empty! So we have to check
|
# maybe the list is empty! So we have to check
|
||||||
if [ "$list_of_userids" != "" ]; then list_of_userids=${list_of_userids::-1}; fi
|
# if [ "$list_of_userids" != "" ]; then list_of_userids=${list_of_userids::-1}; fi
|
||||||
|
list_of_userids=""
|
||||||
for (( i=0; i < ${#new_ZABBIX_ARRAY_disabled_User_userid[*]}; i++ )); do
|
for (( i=0; i < ${#new_ZABBIX_ARRAY_disabled_User_userid[*]}; i++ )); do
|
||||||
list_of_userids+='"'${new_ZABBIX_ARRAY_disabled_User_userid[$i]}'"'
|
list_of_userids+='"'${new_ZABBIX_ARRAY_disabled_User_userid[$i]}'"'
|
||||||
list_of_userids+=","
|
list_of_userids+=","
|
||||||
|
|||||||
Reference in New Issue
Block a user