Installing Zabbix 7.2 agent2 Debian
-
wrote 11 days ago last edited by rick 7 days ago
Install Zabbix 7.2 repo
wget https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian12_all.deb
dpkg -i zabbix-release_latest_7.2+debian12_all.deb
Update repos
apt update
Install Zabbix server and frontend
apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2
Install plugins
apt install zabbix-agent2-plugin-mongodb zabbix-agent2-plugin-mssql zabbix-agent2-plugin-postgresql
Install mysql
wget https://dev.mysql.com/get/mysql-apt-config_0.8.30-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.30-1_all.deb
Error on this new install, where lsb-release is not installed
apt-get install lsb-release
Try again…
dpkg -i mysql-apt-config_0.8.30-1_all.deb
Error, gnupg not installed
apt install gnupg2
Give it another go…
dpkg -i mysql-apt-config_0.8.30-1_all.deb
I had to list upgradable packages :
apt-list --upgradable
Which spit out : mysql-common/unknown 8.4.4-1debian12 all [upgradable from: 5.8+1.1.0]
Then installed mysql-common
apt-get install mysql-common
Had to uninstall Mariadb to resolve these conflicts
apt remove mariadb-client-core
Then install mysql-server:
apt install mysql-server
Enter your password, twice
Now enter mysql by typing :
mysql -u root -p
Enter the following command individually Where ‘password’ is where you type in your actual own password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin; mysql> create user zabbix@localhost identified by 'password'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> set global log_bin_trust_function_creators = 1; mysql> quit;
Populate the database with zabbix script
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
mysql --u root -p
set global log_bin_trust_function_creators = 0; quit;
Edit file /etc/zabbix/zabbix_server.conf You can use nano
nano /etc/zabbix/zabbix_server.conf
Uncomment the DBPassword section, and type your password
Then hold ctrl and tap x, it will ask if you want to save changes.
Enable services:
systemctl enable zabbix-server zabbix-agent2 nginx php8.2-fpm systemctl restart zabbix-server zabbix-agent2 nginx php8.2-fpm
Check that zabbix service has started
journalctl -xeu zabbix-server.service
Delete the 'default site in nginx
sudo rm -rf /etc/nginx/sites-enabled/default
Make sure the symbolic link to the zabbix nginx file is present
ln -s /etc/zabbix/nginx.conf /etc/nginx/sites-enabled/zabbix.conf
Check that the zabbix nginx file is in the includes in nginx config
nano /etc/nginx/nginx.conf
Look for :
include /etc/nginx/sites-enabled/*
Now restart nginx
systemctl restart nginx
Hit the browser and type in the IP (or URL that you may have put in the zabbix nginx config file)
Make sure to configure locales
sudo dpkg-reconfigure locales
Reboot the system
sudo shutdown -r now
Add your database password
Add a server name
The default username is Admin, and the password is zabbix