1、操作环境

[root@Server ~]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m
[root@Server ~]# uname -r
2.6.32-358.el6.x86_64
[root@Server ~]# uname -m
x86_64


2、下载grafana以及安装

[root@Server ~]# wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm
[root@Server ~]# rpm -ivh grafana-2.6.0-1.x86_64.rpm
rpm -ivh grafana-2.6.0-1.x86_64.rpm
warning: grafana-2.6.0-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 3dd18bdd: NOKEY
Preparing...                ########################################### [100%]
   1:grafana                ########################################### [100%
### NOT starting grafana-server by default on bootup, please execute
 sudo /sbin/chkconfig --add grafana-server
### In order to start grafana-server, execute
 sudo service grafana-server start



3、下载zabbix的grafana插件,以及配置相关文件

[root@Server ~]# wget https://codeload.github.com/alexanderzobnin/grafana-zabbix/tar.gz/v2.5.1
[root@Server ~]# tar fxz grafana-zabbix-2.5.1.tar.gz 
[root@Server ~]# cd grafana-zabbix-2.5.1
[root@Server grafana-zabbix-2.5.1]# ls
LICENSE.md  README.md  zabbix
[root@Server grafana-zabbix-2.5.1]# cp -rf zabbix/ /usr/share/grafana/public/app/plugins/datasource/



4、启动grafana服务

[root@Server ~]# /etc/init.d/grafana-server start
Starting Grafana Server: .... OK

5、测试下zabbix-API。

[root@Server ~]# curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{"user":"Admin","password":"zabbix"},"auth":null,"id":0}' http://192.168.75.128/zabbix/api_jsonrpc.php
HTTP/1.1 200 OK
Date: Thu, 28 Apr 2016 07:43:21 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.5.34
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000
Content-Length: 68
Connection: close
Content-Type: application/json
{"jsonrpc":"2.0","result":"21b85be9259926290f10d70bd7428409","id":0}


spacer.gifwKiom1ch6NHSkcn8AABjXD_0hiY812.png

注:成功后就可以登录配置grafana了


6、登录grafana 界面,http://ip:3000 默认用户和密码均为admin

wKioL1ch6eugUg-gAABP4-n30Fk948.png


在grafana上配置zabbix的数据源

spacer.gifwKioL1ch6heSa2eOAAMvz8XanDk344.png

配置后添加item图形。

spacer.gifwKiom1ch6W3jtfNPAASxJeUXygk691.png

就先这样吧。收工,透透气去。。