Zabbix對接Grafana

1、安裝grafana:

[root@zabbix ~]# rpm -ivh grafana-6.7.3-1.x86_64.rpm 
warning: grafana-6.7.3-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 24098cb6: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:grafana-6.7.3-1                  ################################# [100%]
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script

2、根據提示完成配置並啓動服務:

[root@zabbix ~]# systemctl daemon-reload
[root@zabbix ~]# systemctl enable grafana-server
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@zabbix ~]# systemctl start grafana-server

服務運行在3000端口:

[root@zabbix vmuser]# netstat -ntpl|grep 3000
tcp6       0      0 :::3000                 :::*                    LISTEN      18358/grafana-serve

3、訪問http://ip:3000

默認賬號密碼爲admin/admin

4、添加數據源Mysql

保存並測試,如果報錯:

tail -f /var/log/grafana/grafana.log

查看報錯信息,按報錯修改即可。

5、下載zabbix插件,並安裝

下載地址:https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app/installation

下載zip:https://codeload.github.com/alexanderzobnin/grafana-zabbix/legacy.zip/793129b2d602b36b09dc64dab7ec6f5a6f7beb42

解壓到grafana插件目錄,重啓grafana並從web界面啓用插件:

[root@zabbix ~]# unzip alexanderzobnin-grafana-zabbix-v3.11.0-1-g52f24ec.zip -d /var/lib/grafana/plugins/

[root@zabbix ~]# systemctl restart grafana-server

6、再次添加數據源,數據源類型選擇zabbix

HTTP url字段添加zabbix API地址,通常爲:http://ip/zabbix/api_jsonrpc.php。

Zabbix API details字段填寫zabbix web界面的用戶名密碼。啓用Trends,選擇Zabbix version。

Direct DB Connection,選擇enable,Data Source選擇第四步添加的數據源。

7、save and test,編輯儀表板即可。

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