Search code examples
mysqlzabbix

When switching to zabbix 6.2.2, how do we have to change password setting?


Additional info

Now using zabbix 6.2.2 I noticed that /usr/share/doc/zabbix-server-mysql/create.sql.gz no longer exists. After some googling I found zabbix-sql-scripts. Unsure what to import from the new folder /usr/share/doc/zabbix-sql-scripts I picked ./mysql/server.sql.gz because we use MariaDB. This indeed set up the database zabbix.users.

Actual question

However: In the old zabbix version we ran update users set passwd=md5('PASSWORD') where alias='Admin' on zabbix.users. Alias doesn't exist anymore so I switched to update users set passwd=md5('PASSWORD') where username='Admin'. That seemed to do the trick, but didn't. While the command runs without error, the password is not correctly set.

Even though I set login_user: Admin and login_password: PASSWORD ansible fails to connect. This does not happen if the password is not set and standard "zabbix" is used.

Why is setting the password no longer working?

I am still very new to zabbix, but the project worked before on an older zabbix version just importing aforementioned create.sql.gz.


Solution

  • Since 5.0 Zabbix switched from md5 hashing algorithm to bcrypt: https://support.zabbix.com/browse/ZBXNEXT-1898 Since then, on the first log in after upgrade all md5 hashes are converted to bcrypt by Frontend automatically.

    https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/410430-reset-admin-password-for-zabbix-lts-5-0

    Therefore I needed to use bcrypt instead of md5 which I did using the inbuilt ansible command password_hash combined with passlib: How escape random string for linux shell to update mysql datase entry using ansible?