Zabbix 自定義圖形
Zabbix 自帶圖形
Zabbix 圖形樹安裝
# 1.上傳
[root@zabbix ~]# cd /usr/share/zabbix
[root@zabbix zabbix]# wget https://www.itsky.tech/download/zabbix/graphtree3.0.4.patch
# 2.導入,要進入目錄運行 patch 命令
[root@zabbix zabbix]# yum install -y patch
[root@zabbix zabbix]# patch -Np0 < graphtree3.0.4.patch
# 3.移動並授權
[root@zabbix zabbix]# mv oneoaas /usr/share/zabbix/
[root@zabbix zabbix]# chown -R apache.apache /usr/share/zabbix/oneoaas
# 4.修改 Apache 配置⽂文件
[root@zabbix zabbix]# vim /etc/httpd/conf.d/zabbix.conf
[root@zabbix zabbix]# Alias /oneoaas /usr/share/zabbix/oneoaas
# 5.重啟 httpd 服務
[root@zabbix zabbix]# systemctl restart httpd
Grafana 可視化工具
下載 Grafana
# 下載地址:https://mirrors.tuna.tsinghua.edu.cn/
[root@zabbix ~]# wget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/grafana-6.6.1-1.x86_64.rpm
安裝 Grafana
[root@zabbix ~]# yum localinstall -y grafana-6.6.2-1.x86_64.rpm
啟動 Grafana
[root@zabbix ~]# systemctl start grafana-server.service
# 驗證
[root@zabbix ~]# netstat -lntp | grep 3000
tcp6 0 0 :::3000 :::* LISTEN 46915/grafana-server
訪問 Grafana Web
# 訪問
http://10.0.0.71:3000/login
# 登錄
用戶:admin
密碼:admin
# 登錄后讓你重新配置新的密碼
123456
123456
安裝 Grafana-zabbix 插件
# 查看插件列表
[root@zabbix ~]# grafana-cli plugins list-remote
# 找到 zabbix 插件
[root@zabbix ~]# grafana-cli plugins list-remote | grep zabbix
id: alexanderzobnin-zabbix-app version: 4.0.1
[root@zabbix ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
# 安裝插件失敗,因為源在國外,可以使用以下方式
[root@zabbix ~]# cd /var/lib/grafana/plugins/
[root@zabbix plugins]# wget https://www.itsky.tech/download/zabbix/alexanderzobnin-zabbix-app.tar.gz
[root@zabbix plugins]# tar xf alexanderzobnin-zabbix-app.tar.gz
[root@zabbix plugins]# ll
total 9320
drwxr-xr-x 8 root root 4096 May 20 10:57 alexanderzobnin-zabbix-app
-rw-r--r-- 1 root root 9537875 Sep 10 17:26 alexanderzobnin-zabbix-app.tar.gz
# 重啟
[root@zabbix plugins]# systemctl restart grafana-server.service
使用 Grafana
1.登錄頁面 --- 設置 --- plugins
2.點擊 zabbix 插件 --- enable
3.設置 --- add data source --- 選擇 zabbix
4.配置 zabbix 信息
http://10.0.0.71/zabbix/api_jsonrpc.php
配置 Grafana Dashboard
創建模板:
查看默認模板: