1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| cd /soft tar xf zabbix-4.0.5.tar.gz cd zabbix-4.0.5
groupadd zabbix useradd -g zabbix zabbix
cd database/mysql
echo "create database zabbix character set utf8 collate utf8_bin;" | mysql -p echo "grant all privileges on zabbix.* to zabbix@% identified by zabbix;" | mysql -p
mysql -uzabbix -pzabbix -Dzabbix < schema.sql mysql -uzabbix -pzabbix -Dzabbix < images.sql mysql -uzabbix -pzabbix -Dzabbix < data.sql
cd /soft/zabbix-4.0.5 ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \ --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 make install
vim /usr/local/zabbix/etc/zabbix_server.conf DBHost=192.168.2.133 DBName=zabbix DBUser=zabbix DBPassword=zabbix DBPort=3306 ListenIP=192.168.2.133
cd /etc/init.d wget 192.168.1.231/soft/zabbix_server chmod +x zabbix_server
/etc/init.d/zabbix_server start
cp -pr /soft/zabbix-4.0.5/frontends/php /var/www/html/zabbix
#浏览器访问 http://192.168.2.133/zabbix/setup.php进行初始化 #按照相应建议修改php配置 vim /usr/local/php/etc/php.ini post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Shanghai always_populate_raw_post_data = -1
/etc/init.d/httpd restart
#Cannot create the configuration file. 报错 wget 192.168.1.231/soft/zabbix.conf.php #按照相应配置修改文件
#字体乱码解决方法 mkdir -p /var/www/html/zabbix/fonts cd /var/www/html/zabbix/fonts mkdir bak mv * bak wget 192.168.1.231/soft/zabbix4/simkai.ttf 192.168.1.231/soft/zabbix4/DejaVuSans.ttf
|