一、系統搭建(以Centos7為例)
因為我們的主要目的是展示zabbix的數據,所以建議大家直接在zabbix的服務器上搭建這個系統,親測兩系統無沖突,這樣部署的好處是兩系統間的數據傳輸更快,前端展示加載速度也將更快。
首先簡單粗暴點,關閉防火牆,以免系統啟動的時候出問題。
關閉防火牆
[root@localhost ~]# systemctl stop firewalld.service
關閉防火牆的開機自啟
[root@localhost ~]# systemctl disable firewalld.service Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
替換防火牆參數
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
查看防火牆狀態
[root@localhost ~]# grep SELINUX=disabled /etc/selinux/config SELINUX=disabled
關閉當前防火牆
[root@localhost ~]# setenforce 0
下載rpm源並安裝
wget https://dl.grafana.com/oss/release/grafana-5.4.2-1.x86_64.rpm yum localinstall grafana-5.4.2-1.x86_64.rpm -y
安裝插件(這里以zabbix插件為例,其他插件可以去上面的插件庫鏈接里看,需要的再安裝)
grafana-cli plugins install alexanderzobnin-zabbix-app
也可以查看grafana-zabbix-app 庫,安裝最新的插件:
cd /var/lib/grafana/plugins git clone https://github.com/alexanderzobnin/grafana-zabbix-app
然后重啟grafana
最后啟動Grafana並添加開機啟動項即可。
systemctl start grafana-server systemctl enable grafana-server
二、對接zabbix系統
首先打開grafana頁面,地址為:你的grafana服務器ip地址+3000端口(比如192.168.0.2:3000),然后我們就可以看到如下登錄界面:
1、默認帳號密碼均為admin
2、修改密碼(可選)
3、然后我們開始配置數據源,點擊add data source綠色按鈕:
4、數據源鏈接配置:http://10.90.6.86/zabbix/api_jsonrpc.php
5、結果