OS: CentOS7.0.1406 Zabbix版本: Zabbix-3.2 下載地址: http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm MySQL版本: 5.6.37 MySQL: http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
1. [root@zabbix ~]# rpm -ivh zabbix-release-3.2-1.el7.noarch.rpm warning: zabbix-release-3.2-1.el7.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zabbix-release-3.2-1.el7 ################################# [100%] 2. [root@zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent 3. 安裝MySQL(Centos7默認數據庫是mariadb) [root@zabbix ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm [root@zabbix ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:mysql-community-release-el7-5 ################################# [100%] [root@zabbix ~]# yum install mysql-community-server [root@zabbix ~]# systemctl enable mysqld [root@zabbix ~]# systemctl start mysqld 4. 設置密碼 [root@zabbix ~]# mysqladmin -uroot password "newpasswd" 5. 建立數據庫 mysql> create database zabbix character set utf8 collate utf8_bin; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; Query OK, 0 rows affected (0.00 sec) 6. 導入數據 [root@zabbix ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.7 [root@zabbix zabbix-server-mysql-3.2.7]# zcat create.sql.gz | mysql -uroot -p zabbix * Zabbix是數據庫名,不是密碼 7.配置zabbix-server [root@zabbix zabbix-server-mysql-3.2.7]# vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix [root@zabbix zabbix-server-mysql-3.2.7]# systemctl enable zabbix-server.service Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service. [root@zabbix zabbix-server-mysql-3.2.7]# systemctl start zabbix-server.service 8. 修改時區 vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai 9. 啓動httpd [root@zabbix ~]# systemctl start httpd [root@zabbix ~]# systemctl enable httpd
1. 訪問: http://ip/zabbixphp
2. 登陸mysql
默認用戶名密碼: Admin/zabbix
web
3. 問題: 中文亂碼sql
解決方法: Win+R打開運行,輸入fonts,回車進入Windows字體目錄,找到微軟雅黑-常規字體,複製出來將文件名修改成msyh.ttf,而後上傳到/usr/share/zabbix/fonts 上傳到/usr/share/zabbix/fonts/,將graphfont.ttf備份 mv msyh.ttf graphfont.ttf chmod 777 graphfont.ttf
4. 刷新頁面
數據庫