Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1

yum安裝zabbix 5.2.1 數據庫mysql 8.0
系統版本CentOS Linux release 8.2.2004

##查看系統版本
[root@Zabbix-Server ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)

##關閉selinux
[root@Zabbix-Server ~]# vi /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
##禁用防火牆
[root@Zabbix-Server ~]# systemctl disable --now firewalld
##重啓
[root@Zabbix-Server ~]# reboot
##查看selinux狀態
[root@Zabbix-Server ~]# sestatus
SELinux status: disabled
##查看防火牆狀態
[root@Zabbix-Server ~]# systemctl status firewalld.service











##安裝數據庫
[root@Zabbix-Server ~]# yum install -y mysql-server
##開啓數據庫服務
service mysqld start
##查看數據庫狀態
service mysqld status
##設置數據庫開機啓動
systemctl enable mysqld.service
##啓動mysql
systemctl start mysqld.service
##查看數據庫版本
mysqld -V
##查看數據庫版本
mysql -V












##使用命令初始化數據庫
mysql_secure_installation
##按提示初始化數據庫

##登錄數據庫
[root@Zabbix-Server ~]# mysql -u root -p
##創建zabbix數據庫
mysql> create database zabbix character set utf8 collate utf8_bin;
##創建zabbix user
mysql> create user zabbix@localhost identified by 'Start123!';
##查看數據庫
mysql> show databases;
##查看用戶與數據庫
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
##給zabbix用戶授權訪問zabbix數據庫
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' ;
##轉到zabbix數據庫
mysql> use zabbix;
##刷新權限
mysql> flush privileges;
##退出
mysql> quit;
[root@Zabbix-Server ~]#

















##安裝 zabbix rpm 源,
[root@Zabbix-Server ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/zabbix-release-5.2-1.el8.noarch.rpm
##清空源緩存
[root@Zabbix-Server ~]# dnf clean all
##安裝相關服務,如網絡不好, 可以多試幾次
[root@Zabbix-Server ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent
##導入數據庫
[root@Zabbix-Server ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
##修改zabbix_server.conf中DBPassword值爲zabbix用戶的密碼
[root@Zabbix-Server ~]# vi /etc/zabbix/zabbix_server.conf
DBPassword=Start123!
##重啓服務
[root@Zabbix-Server ~]# systemctl restart zabbix-server.service zabbix-agent.service httpd php-fpm.service
##添加開機啓動zabbix_server服務
[root@Zabbix-Server ~]# systemctl enable zabbix-server.service zabbix-agent.service httpd php-fpm.service













安裝完成,通過網頁訪問http://ip/zabbix,用戶名Admin,密碼zabbix
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
##修復中文亂碼
[root@Zabbix-Server ~]# cd /usr/share/zabbix/assets/fonts/
##能過rz命令上傳simhei.ttf字體文件到/usr/share/zabbix/assets/fonts/目錄中
[root@Zabbix-Server ~]# rz
##重命名graphfont.ttf字體文件
[root@Zabbix-Server fonts]# mv graphfont.ttf graphfont.ttf.bak
##添加軟鏈接,設置simhei.ttf字體文件爲graphfont.ttf
[root@Zabbix-Server fonts]# ln -s simhei.ttf graphfont.ttf








##下載grafana.rpm文件
[root@Zabbix-Server ~]# wget https://dl.grafana.com/oss/release/grafana-7.3.3-1.x86_64.rpm
##安裝grafana
[root@Zabbix-Server ~]# yum install grafana-7.3.3-1.x86_64.rpm -y
##開啓,並設置開機啓動
[root@Zabbix-Server ~]# systemctl start grafana-server
[root@Zabbix-Server ~]# systemctl enable grafana-server





##網頁登錄grafana, http://ip:3000
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1

##使用迅雷下載zabbix插件
https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/3.11.0/download
##跳到/var/lib/grafana/plugins/目錄
[root@Zabbix-Server ~]# cd /var/lib/grafana/plugins/
##上傳文件
[root@Zabbix-Server plugins]# rz
##使用uzip解壓插件,
[root@Zabbix-Server plugins]# uzip alexanderzobnin-grafana-zabbix-v3.11.0-1-g52f24ec.zip
[root@Zabbix-Server plugins]# ls
alexanderzobnin-grafana-zabbix-v3.11.0-1-g52f24ec
alexanderzobnin-grafana-zabbix-v3.11.0-1-g52f24ec.zip
##重啓服務
[root@Zabbix-Server plugins]# systemctl restart grafana-server.service











啓用zabbix插件
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
點擊enable啓用
配置data sources
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
url爲http://localhost/zabbix/api_jsonrpc.php
zabbix api details中username和password爲zabbix的管理員用戶名密碼
zabbix version爲4.X
添加儀表板
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1
Centos 8.2 安裝Zabbix 5.2.1+Grafana7.3.1













發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章