Zabbix installation with PostgreSQL database This note was created on 2020-09-27 This note was last edited on 2023-01-31 Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual machines (VMs) and cloud services. Zabbix provides monitoring metrics, among others network utilization, CPU load and disk space consumption. Read more on the official website: https://www.zabbix.com === Installation === 1. Install PostegreSQL: # apt install postgresql postgresql-contrib 2. Install Apache: # apt install apache2 apache2-utils 3. Install Zabbix: # apt install zabbix-server-pgsql zabbix-frontend-php 4. Install Certbot: # apt install certbot python3-certbot-nginx python3-certbot-apache === PostgreSQL configuration === 1. Create database user: $ sudo -u postgres createuser --pwprompt zabbix 2. Create database for Zabbix: $ sudo -u postgres createdb -O zabbix -E Unicode -T template0 zabbix 3. Configure database: $ zcat /usr/share/zabbix-server-pgsql/schema.sql.gz | sudo -u zabbix psql zabbix $ zcat /usr/share/zabbix-server-pgsql/images.sql.gz | sudo -u zabbix psql zabbix $ zcat /usr/share/zabbix-server-pgsql/data.sql.gz | sudo -u zabbix psql zabbix === Zabbix configuration === 1. Configure access to database in "/etc/zabbix/zabbix_server.conf": ~~~ DBHost= DBName=zabbix DBUser=zabbix DBPassword= ~~~ 2. Enable and start service: # systemctl enable zabbix-server # systemctl start zabbix-server === Apache configuration === 1. Set which ports to by Apache in "/etc/apache2/ports.conf". 2. Open desired port(s): # firewall-cmd --permanent --zone=public --add-port=8880/tcp # firewall-cmd --reload 3. Disable server info by changing following parameters in "/etc/apache2/conf-enabled/security.conf": ~~~ ServerTokens Prod ServerSignature Off ~~~ 4. Enable Zabbix configuration file in Apache: # cp /etc/apache2/conf-available/zabbix-frontend-php.conf /etc/apache2/conf-enabled/zabbix.conf 5. Set timezone for Zabbix in "/etc/apache2/conf-enabled/zabbix.conf". 6. Enable and start Apache: # systemctl enable apache2 # systemctl start apache2 === Nginx configuration (optional) === If your server behind Nginx proxy, configure it too: ~~~ server { server_name zabbix.example.com; location / { include /etc/nginx/proxy_params; proxy_pass http://localhost:8880; proxy_read_timeout 90s; proxy_redirect http://localhost:8880 https://zabbix.example.com; } } ~~~ === HTTPS configuration === - Just run "certbot" and answer it's questions. - Restart your webserver. === Finish Zabbix configuration === Go to zabbix.example.com/zabbix and finish configuration. Default login/password is "Admin/zabbix". At the end, you will need to download and save the configuration file on a server manually.