Projects

Zabbix

This is a simple guide to setting up Zabbix 6.4 on Ubuntu 20.04 LTS server. I've added these steps here to make the process easier. If you encounter any problems, please see below for some trouble shooting notes.

https://www.zabbix.com/download?zabbix=6.4&os_distribution=ubuntu&os_version=22.04

Software Versions

Steps

  1. Copy the script below into a file install.sh
  2. Change the script to execution: chmod +x install.sh
  3. Execute the script: sudo ./install.sh
#Update and install mysql
sudo apt update && sudo apt upgrade -y && sudo apt -y install mysql-server && sudo systemctl start mysql.service
#Download zabbix
wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release\_6.4-1+ubuntu20.04\_all.deb
#Install zabbix
dpkg -i zabbix-release\_6.4-1+ubuntu20.04\_all.deb
#Update
apt update
#Install zabbix components
apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

Once Zabbix has been installed the database needs to be configured. Logging into mysql may require sudo privilege to login. Once in mysql, the db will need to be created, zabbix user created, zabbix user permission granted, and set the log_bin_trust_function_creators. This is condensed into one SQL line below. It can be read in full on the Zabbix page from the link above. Please change zabbixPassword to a secure password:

sudo mysql

create database zabbix character set utf8mb4 collate utf8mb4_bin; create user zabbix@localhost identified by 'zabbixPassword'; grant all privileges on zabbix.* to zabbix@localhost; set global log_bin_trust_function_creators = 1; quit;

Next you will need to configure the Zabbix user database password. Set the parameter in the following file to your Zabbix users password created in the sql statement above:

sudo nano /etc/zabbix/zabbix_server.conf

DBPassword=zabbixPassword

The next step is to merge the Zabbix SQL into the database for the configuration.

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -D zabbix -uzabbix -pzabbixUbu

Finally, remove super privivilege and log_bin_trust_function

sudo mysql;
update mysql.user SET Super_Priv='N' where user='zabbix' AND host='localhost';set global log_bin_trust_function_creators = 0; quit;

Once the merge is complete, restart and enable zabbix. After the restart, you should now be able to view Zabbix in the browser:

systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2

Local Zabbix

Here are some parameters to set help with the Zabbix Web Configuration:

Default login:Admin
Default password:zabbix
MYSQL port:3306

Problems

ERROR 1046 (3D000) at line 1: No database selected

Add the -D databasename

mysql -D zabbix -p < images_mysql.sql

https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/7215-can-t-create-mysql-schema