1、系統環境 cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) 關閉防火牆及selinux systemctl stop firewalld.service systemctl disable firewalld.service sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config grep SELINUX=disabled /etc/selinux/config setenforce 0 2、安裝mariadb yum install mariadb-server mariadb -y
配置數據庫的相關信息:/etc/my.cnf
[mysqld]
datadir=/home/mysql
socket=/var/lib/mysql/mysql.sock
innodb_file_per_table=1 #打開InnoDB引擎獨立表空間php
mariadb數據庫啓動: systemctl start mariadb #啓動MariaDB systemctl enable mariadb #設置開機啓動
登陸數據庫查看獨立表空間
MariaDB [(none)]> show variables like '%per_table%'; #查看獨立表空間是否打開
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | ON |
+-----------------------+-------+
1 row in set (0.00 sec)前端
zabbixe中文文檔 https://www.zabbix.com/documentation/3.4/zh/manual 2、Zabbix3.4安裝 rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql -y 3、建立數據庫 create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; 4、導入數據 zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uzabbix -pzabbix zabbix
設置數據庫root密碼、默認爲空、設置mysql安全參數命令:
mysql_secure_installationnode
5、配置數據庫用戶及密碼 grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf 38:LogFile=/var/log/zabbix/zabbix_server.log 49:LogFileSize=0 72:PidFile=/var/run/zabbix/zabbix_server.pid 99:DBName=zabbix 115:DBUser=zabbix 123:DBPassword=zabbix 314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log 432:Timeout=4 474:AlertScriptsPath=/usr/lib/zabbix/alertscripts 484:ExternalScripts=/usr/lib/zabbix/externalscripts 520:LogSlowQueries=3000 6、啓動zabbix server並設置開機啓動 systemctl enable zabbix-server systemctl start zabbix-server 7、編輯Zabbix前端PHP配置,更改時區 vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai 8、啓動httpd並設置開機啓動 systemctl start httpd systemctl enable httpd systemctl start zabbix-server.service systemctl enable zabbix-server.service 9、安裝客戶端 yum install zabbix-agent systemctl enable zabbix-agent.service systemctl start zabbix-agent.service
經過zabbix管理界面的profile ——> Language 能夠修改系統的默認語言設置 。默認是English(en_GB) ,經過下拉選項選擇Chinese(zh_CN)並按save保存後,能夠更改默認語言爲中文 。更改完成後大部分頁面顯示是沒問題的,不過在maps 或 screen 等graphs 時,會出現漢字沒法顯示 ------ 顯示爲口口 。mysql
出現該問題的緣由是由於zabbix的web端沒有中文字庫,把中文字庫加上便可 。解決方法能夠由下面幾步完成:linux
1、複製字體文件web
從windows下控制面板->字體->選擇一種中文字庫例如「楷體」 ,複製出來的字體文件爲simkai.ttf 。sql
[root@linux-node1-example zabbix]# pwd #路徑 /usr/share/zabbix [root@linux-node1-example zabbix]# cd fonts #在該路徑下存放下載的字體 [root@linux-node1-example fonts]# ls graphfont.ttf simkai.ttf [root@linux-node1-example fonts]# 2、修改defines.inc.php文件 修改zabbix的web端/include/defines.inc.php : sed -i 's/graphfont/simkai/g' /usr/share/zabbix/include/defines.inc.php 若是是編譯安裝的可能不在這個路徑能夠find查找該文件 find / -name "defines.inc.php"
修改完成後,刷新頁面,效果以下:數據庫