Installation source
- Tsinghua Yuan
surroundings
- ubuntu 1804 zabbix 4.0.x
Commonly used and compiled dependencies and toolkits
apt install iproute2 ntpdate nfs-kernel-server nfs-common zlib1g-dev telnet gcc openssh-server lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev tcpdump unzip zip -y
zabbix包
Dependent packages
apt-get install apache2 apache2-bin apache2-data apache2-utils fontconfig-config fonts-dejavu-core fping libapache2-mod-php libapache2-mod-php7.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libfontconfig1 libgd3 libiksemel3 libjbig0 libjpeg-turbo8 libjpeg8 liblua5.2-0 libodbc1 libopenipmi0 libsensors4 libsnmp-base libsnmp30 libsodium23 libssh2-1 libtiff5 libwebp6 libxpm4 php-bcmath php-common php-gd php-ldap php-mbstring php-mysql php-xml php7.2-bcmath php7.2-cli php7.2-common php7.2-gd php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml snmpd ssl-cert ttf-dejavu-core php-gettext php-xml php-net-socket php-gd php-mysql libmysqlclient-dev libxml2-dev libxml2 snmp libsnmp-dev libevent-dev openjdk-8-jdk curl libcurl4-openssl-dev -y
Compilation parameters
./configure --prefix=/apps/zabbix_server --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-java
Zabbix database preparation
-
apt install mysql-server mysql-client -y
-
Modify the listening address
-
Open service after modification
-
Create a database
-
create database zabbix_server character set utf8 collate utf8_bin;
-
Create user permissions and passwords
-
grant all privileges on zabbix_server.* to zabbix@"192.168.%" identified by '123456';
-
User: zabbix Allow host: 192.168.0.0/24 Password: 123456
-
flush privileges;
-
Test login
Import data to mysql
- mysql -uzabbix -pmagedu.zabbix -h172.31.0.104 zabbix_server < schema.sql
- mysql -uzabbix -pmagedu.zabbix -h172.31.0.104 zabbix_server < images.sql
- mysql -uzabbix -pmagedu.zabbix -h172.31.0.104 zabbix_server < data.sql
- Sequential execution, otherwise it will cause foreign key constraints
- View database import
- mysql -uzabbix -p123456 -h192.168.47.150
- use zabbix_server;
- show databases;
Set up zabbix.conf
Set php parameters
- im /etc/php/7.2/apache2/php.ini
- If still not satisfied, re-modify this configuration file and restart apache2
Start service
Configure the front-end page (php)
-
mkdir /var/www/html/zabbix&& cd /root/zabbix-4.0.19/frontends/php/ &&cp -a . /var/www/html/zabbix/
-
Visit the installation page
-
This step may report an error. The generated configuration file cannot be saved. In this case, save the configuration file locally, and then use lrzsz to transfer it to the / var / www / html / zabbix / conf / directory, and then click Finish
-
After login