一、安裝zabbix最新版epel源:php
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
二、安裝zabbix服務端軟件包:mysql
yum install zabbix-server-mysql zabbix-web-mysql -y CentOS 7.x上MySQL數據庫叫mariadb,須要安裝如下包,請你們自行yum安裝: [root@localhost conf.d]# rpm -qa | grep maria mariadb-5.5.52-1.el7.x86_64 mariadb-libs-5.5.52-1.el7.x86_64 mariadb-server-5.5.52-1.el7.x86_64 mariadb-test-5.5.52-1.el7.x86_64 mariadb-devel-5.5.52-1.el7.x86_64 [root@localhost conf.d]# mysql_secure_installation #數據庫初始化命令
三、安裝並配置MySQL數據庫:web
MariaDB [(none)]> create user zabbix identified by '123456'; MariaDB [(none)]> create database zabbix; MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'%' identified by '123456'; MariaDB [(none)]> flush privileges;
四、導入zabbix服務器數據庫文件:sql
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -u zabbix -p123456 -D zabbix
五、修改zabbix配置文件:數據庫
[root@localhost conf.d]# more /etc/zabbix/zabbix_server.conf | grep -v "#" | grep -v "^$" LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBName=zabbix DBUser=zabbix DBPassword=123456 #只須要設備MySQL數據庫zabbix用戶對應密碼 SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
六、修改Apache服務器下,php相關的配置文件:centos
[root@localhost conf.d]# vi /etc/httpd/conf.d/zabbix.conf php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/Shanghai #該項取消註釋,並設置對應的時區
七、配置完成,啓動zabbix管理界面完成最後的安裝配置,設置zabbix-server與mariadb啓動與開機啓動:服務器
[root@localhost]# systemctl start zabbix-server [root@localhost]# systemctl enable zabbix-server [root@localhost]# systemctl start mariadb [root@localhost]# systemctl enable mariadb [root@localhost]# systemctl start httpd [root@localhost]# systemctl enable httpd
八、Web登陸:http://服務器IP/zabbix,Ok搞定了! app
九、Zabbix界面顯示亂碼問題解決:frontend
字體存放的目錄:/usr/share/zabbix/fonts/ide
[root@localhost zabbix]# ll /usr/share/zabbix/include/defines.inc.php
[root@localhost zabbix]# sed -i 's/graphfont/DejaVuSans/g' ./include/defines.inc.php
[root@localhost zabbix]# ll fonts/
總用量 17960
-rwxrwxrwx. 1 root root 18387092 8月 24 15:48 DejaVuSans.ttf
lrwxrwxrwx. 1 root root 33 8月 24 13:55 graphfont.ttf -> /etc/alternatives/zabbix-web-font
參考文章: