apt-get update
apt-get install git libpcre2-8-0 wget build-essential automake pkg-config autoconf autogen vim libmysqlclient-dev libxml2-dev libsnmp-dev libssh2-1-dev libopenipmi-dev libevent-dev libcurl4-openssl-dev libpcre3-dev unixodbc-dev golang-go openjdk-17-jdk libldap2-dev libgnutls28-dev libmodbus-dev libmysqlclient-dev net-tools
wget https://cdn.zabbix.com/zabbix/sources/stable/5.4/zabbix-5.4.7.tar.gz
tar xvfz zabbix-5.4.7.tar.gz
cd zabbix-5.4.7
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-ssh2 --with-unixodbc --enable-proxy --enable-java --enable-webservice --enable-ipv6 --with-ldap --enable-agent2 --with-openssl --with-libmodbus --prefix=/var/lib/zabbix
make
make install
- Copy Zabbix UI (Web Interface)
cp -Rfv ~/zabbix-5.4.7/ui/ /var/lib/zabbix_ui
-
sudo addgroup --system --quiet zabbix
-
sudo adduser --quiet --system --disabled-login --ingroup zabbix --home /var/lib/zabbix --no-create-home zabbix
-
sudo mkdir -m u=rwx,g=rwx,o= -p /var/lib/zabbix
-
sudo chown zabbix:zabbix /var/lib/zabbix
-
Create the service
zabbix-server
in SystemDsudo tee /etc/systemd/system/zabbix-server.service <<EOF [Unit] Description=Zabbix Server (MySQL/MariaDB) Documentation=man:zabbix_server After=network.target mysql.service [Service] Type=simple User=zabbix Group=zabbix ExecStart=/var/lib/zabbix/sbin/zabbix_server --foreground ExecReload=/var/lib/zabbix/sbin/zabbix_server -R config_cache_reload Restart=always [Install] WantedBy=multi-user.target EOF
-
Configure Server Conf file:
/var/lib/zabbix/etc/zabbix_server.conf
Example: Configuration File Options
LogType=file LogFile=/tmp/zabbix_server.log ListenIP=127.0.0.1 ListenPort=9997 DebugLevel=3 DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=xuechae1wahc8Jee8ceeni StartPollers=10 StartPreprocessors=10 StartPollersUnreachable=10 StartPingers=10 StartDiscoverers=10 StartHTTPPollers=10 StartTimers=10 StartAlerters=10 CacheSize=500M StartDBSyncers=4 HistoryCacheSize=160M HistoryIndexCacheSize=114M TrendCacheSize=114M Timeout=4 LogSlowQueries=3000 StartLLDProcessors=10 StatsAllowedIP=127.0.0.1 StartReportWriters=2 WebServiceURL=http://localhost:9998/report
-
sudo systemctl daemon-reload
-
sudo systemctl start zabbix-server
-
sudo systemctl enable zabbix-server
-
Verify:
sudo systemctl status -l zabbix-server
- GnuTLS is not compatible with zabbix-agent2
- Proceed with the Database Configuration to be used by Zabbix-Server
- Adjust the Zabbix-Server configuration file:
vim /var/lib/zabbix/etc/zabbix_server.conf
- Check the Zabbix-Server log file:
tail -f /tmp/zabbix_server.log