New script: Set Zabbix Auth Type
This commit is contained in:
parent
076bffa5a6
commit
46151e29ed
9
zabbix-authention-type-cli/README.md
Normal file
9
zabbix-authention-type-cli/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
# Set Zabbix Authentication Type from CLI
|
||||
|
||||
If you're locked out of Zabbix account due to reasons like LDAP server unreachable or forgot to set "Zabbix Super Admin" to LDAP admin user
|
||||
you can used this script to switch back to "Internal" authention method and login with local zabbix admin account
|
||||
|
||||
|
||||
|
BIN
zabbix-authention-type-cli/demo.png
Normal file
BIN
zabbix-authention-type-cli/demo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 239 KiB |
BIN
zabbix-authention-type-cli/locked-out.png
Normal file
BIN
zabbix-authention-type-cli/locked-out.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
60
zabbix-authention-type-cli/set-zabbix-auth-type.sh
Normal file
60
zabbix-authention-type-cli/set-zabbix-auth-type.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
read -p "Database Host [localhost]: " DB_HOST
|
||||
read -p "Database Port [3306]: " DB_PORT
|
||||
read -p "Database Name [zabbix]: " DB_NAME
|
||||
read -p "Database User [zabbix]: " DB_USER
|
||||
read -s -p "Database Password [zabbix]: " DB_PASS
|
||||
|
||||
if [ "$DB_HOST" = "" ]
|
||||
then
|
||||
DB_HOST=localhost
|
||||
else
|
||||
:
|
||||
fi
|
||||
if [ "$DB_PORT" = "" ]
|
||||
then
|
||||
DB_PORT=3306
|
||||
else
|
||||
:
|
||||
fi
|
||||
if [ "$DB_NAME" = "" ]
|
||||
then
|
||||
DB_NAME=zabbix
|
||||
else
|
||||
:
|
||||
fi
|
||||
if [ "$DB_USER" = "" ]
|
||||
then
|
||||
DB_USER=zabbix
|
||||
else
|
||||
:
|
||||
fi
|
||||
if [ "$DB_PASS" = "" ]
|
||||
then
|
||||
DB_PASS=zabbix
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Select Authention Type"
|
||||
echo "0 - Internal"
|
||||
echo "1 - LDAP"
|
||||
read -p "Please Input: " AUTHTYPE
|
||||
echo ""
|
||||
if [ "$AUTHTYPE" = "0" ]
|
||||
then
|
||||
:
|
||||
elif [ "$AUTHTYPE" = "1" ]
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "There was an error"
|
||||
exit
|
||||
fi
|
||||
|
||||
mysql -u ${DB_USER} -p${DB_PASS} \
|
||||
-h ${DB_HOST} -P ${DB_PORT} \
|
||||
-D ${DB_NAME} \
|
||||
--execute="update zabbix.config set authentication_type='${AUTHTYPE}' where configid='1'";
|
Loading…
x
Reference in New Issue
Block a user