天天看點

CentOS 7.3安裝Zabbix3.2

一、ZABBIX概述 

Zabbix是一個基于Web界面的分布式系統監控的企業級開源軟體。可以監視各種系統與裝置的參數,保障伺服器及裝置的安全營運。 

Zabbix的功能和特性: 

1、安裝與配置簡單; 

2、可視化web管理界面; 

3、免費開源; 

4、支援中文; 

5、自動發現; 

6、分布式監控; 

7、實時繪圖。 

Zabbix的架構:

CentOS 7.3安裝Zabbix3.2

1、Zabbix Server:負責接收Agent發送的報告資訊,組織所有配置、資料和操作。 

2、Database Storage:存儲配置資訊以及收集到的資料。 

4、Web Interface:Zabbix的GUI 接口,通常與Server運作在同一台機器上。 

5、Proxy:可選元件,常用于分布式監控環境中。 

6、Agent:部署在被監控主機上,負責收集資料發送給Server。 

工作流程: 

Agent擷取被監控端資料,發送給Server。 

Server記錄所接收到的資料,存儲在Database中并按照政策進行相應操作。 

如果是分布式,Server會将資料傳送一份到上級Server中。 

Web Interface将收集到的資料和操作資訊顯示給使用者。 

二、系統環境準備 

[[email protected] ~]# cat /etc/RedHat-release  

CentOS Linux release 7.3.1611 (Core) 

Zabbix3.2 

1、防火牆及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、yum源配置 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 

cd /etc/yum.repos.d/ 

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo 

yum -y install http://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm 

yum install http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm -y 

三、zabbix安裝 

1、yum源安裝 

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb-server 

2、啟動mariadb資料庫 

systemctl start mariadb.service 

systemctl enable mariadb.service 

3、建立資料庫 

mysql -uroot -p 

create database zabbix character set utf8 collate utf8_bin; 

grant all privileges on zabbix.* to [email protected] identified by 'zabbix'; 

4、初始資料導入 

cd /usr/share/doc/zabbix-server-mysql-3.2.3/ 

zcat create.sql.gz |mysql -uroot zabbix 

四、zabbix配置 

1、編輯zabbix_server.conf 

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 

81:DBHost=localhost 

91:DBName=zabbix 

107:DBUser=zabbix 

115:DBPassword=zabbix 

287:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log 

413:Timeout=4 

455:AlertScriptsPath=/usr/lib/zabbix/alertscripts

465:ExternalScripts=/usr/lib/zabbix/externalscripts

501:LogSlowQueries=3000 

2、啟動zabbix server并設定開機啟動 

systemctl enable zabbix-server 

systemctl start zabbix-server 

3、編輯Zabbix前端PHP配置,更改時區 

vim /etc/httpd/conf.d/zabbix.conf 

php_value date.timezone Asia/Shanghai

4、啟動httpd并設定開機啟動 

systemctl start httpd 

systemctl enable httpd 

五、安裝Zabbix Web 

1、浏覽器通路,并進行安裝 

http://172.16.8.210/zabbix/ 

CentOS 7.3安裝Zabbix3.2

2、點選next會出現檢查狀态

CentOS 7.3安裝Zabbix3.2

3、檢查系統環境設定,必須全部都為ok,才能繼續

CentOS 7.3安裝Zabbix3.2

4、輸入連接配接到資料庫詳細資訊。Zabbix資料庫必須已經建立好

CentOS 7.3安裝Zabbix3.2

5、連接配接Zabbix服務細節,如果沒有改變可選擇預設

CentOS 7.3安裝Zabbix3.2

6、設定概要顯示

CentOS 7.3安裝Zabbix3.2

 7、完成安裝,會将在/etc/zabbix/web/zabbix.conf.php生成配置檔案

CentOS 7.3安裝Zabbix3.2

8、預設使用者名/密碼:Admin/zabbix

CentOS 7.3安裝Zabbix3.2

17、zabbix簡單配置

17.1 修改界面為中文

CentOS 7.3安裝Zabbix3.2
CentOS 7.3安裝Zabbix3.2
CentOS 7.3安裝Zabbix3.2

17.2 解決圖形顯示中文亂碼,在儀表闆的常用的圖形欄目裡随意添加一個圖形,我這裡添加的是cpu負載,進入圖形界面會看到亂碼

CentOS 7.3安裝Zabbix3.2

17.2.1 Win+R打開運作,輸入fonts,回車進入Windows字型目錄,找到微軟雅黑-正常字型,複制出來将檔案名修改為msyh.ttf,然後上傳到/usr/share/zabbix/fonts

17.2.2 上傳成功以後,修改defines.inc.php的第45行,将graphfont改為msyh

vim /usr/share/zabbix/include/defines.inc.php

CentOS 7.3安裝Zabbix3.2

17.2.3 儲存後,重新整理界面,文字就出來了

CentOS 7.3安裝Zabbix3.2

轉載于:https://www.cnblogs.com/drizzle-xu/p/9013398.html