Grafana-zabbix Installation
Itnihao
Version: v1.0
Date: 2015-07-13
First, install the Grafana
What is Grafana, reference Http://www.oschina.net/p/grafana
Installing the Reference document http://docs.grafana.org/v2.0/installation/
Grafana Demo site http://play.grafana.org/
Shell#sudo Yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.2-1.x86_64.rpm "If the wall, please fix it by yourself"
Installation package Details
Binary file/usr/sbin/grafana-server
Startup script/etc/init.d/grafana-server
environment variable/etc/sysconfig/grafana-server
Configuration file/etc/grafana/grafana.ini
SYSTEMD Service Grafana-server.service
Log/var/log/grafana/grafana.log
Sqlite3 Database/var/lib/grafana/grafana.db
Start the service
Shell#sudo Service Grafana-server Start
Service Details
Start User Grafana
Service Name Grafana-server
Default Port 3000
Account Admin
Password admin
Service Self-starter
Shell #sudo/sbin/chkconfig--add grafana-server
# # # #CentOS7 # #
Shell #sudo systemctl daemon-reload
Shell #sudo systemctl start Grafana-server
Shell #sudo systemctl Status Grafana-server
Shell #sudo systemctl Enable Grafana-server.service
Second, install the Grafana-zabbix plug-in
Https://github.com/alexanderzobnin/grafana-zabbix
Shell #git Clone https://github.com/alexanderzobnin/grafana-zabbix/
Shell #sudo cp-r grafana-zabbix/zabbix//usr/share/grafana/public/app/plugins/datasource/
Shell #ls/usr/share/grafana/public/app/plugins/datasource/
Shell #sudo Vim/usr/share/grafana/public/app/plugins/datasource/zabbix/plugin.json
{
" plugintype": "DataSource",
"name": "Zabbix",
"type": "Zabbix",
" serviceName": "Zabbixapidatasource",
"module": "Plugins/datasource/zabbix/datasource",
"partials": {
"config": "app/plugins/datasource/zabbix/partials/config.html",
"Query": "app/plugins/datasource/zabbix/partials/query.editor.html",
" annotations": "app/plugins/datasource/zabbix/partials/annotations.editor.html"
},
" username": "Guest", #配置用户名, note that this user exists in Zabbix, and has read-only access to Zabbix data (no write permission required)
"Password" : "Guest" , #配置密码
"metrics": true,
"annotations": true
}
Restart Service
Shell#sudo Service Grafana-server Restart
Modify the Zabbix API file and add the following configuration because Zabbix2.2 supports cross-domain issues
#sudo vim/usr/share/zabbix/api_jsonrpc.php
header (' access-control-allow-origin: * ');
header (' Access-control-allow-headers:content-type ');
header (' access-control-allow-methods:post ');
header (' access-control-max-age:1000 ');
if ($_server[' Request_method '] = = = ' OPTIONS ') {
return;
}
#在此之前添加
Require_once dirname (__file__). ' /include/func.inc.php ';
Require_once dirname (__file__). ' /include/classes/core/chttprequest.php ';
Third, configuration Grafana
650) this.width=650; "src=" http://ww4.sinaimg.cn/large/65b71c64gw1eu15jymbzqj213e0lbwg9.jpg "style=" border:0px; margin:0px auto;padding:5px 0px; "alt=" 65b71c64gw1eu15jymbzqj213e0lbwg9.jpg "/> Configuration Datasource
650) this.width=650; "src=" http://ww1.sinaimg.cn/large/65b71c64gw1eu15jzdh6vj213e0kgmz1.jpg "style=" border:0px; margin:0px auto;padding:5px 0px; "alt=" 65b71c64gw1eu15jzdh6vj213e0kgmz1.jpg "/> configuration Zabbix user, password, Note that the account exists in the Zabbix and has read-only access
650) this.width=650; "src=" http://ww1.sinaimg.cn/large/65b71c64gw1eu15k0dtqxj20st0gyju0.jpg "style=" border:0px; margin:0px auto;padding:5px 0px; "alt=" 65b71c64gw1eu15k0dtqxj20st0gyju0.jpg "/>
Okay, here's the installation.
Now add Grafana graphics, reference https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage, specific graphics use no longer detailed, reference Grafana use temperature
If you do not have the option of group grouping when adding graphics, it indicates that there is a problem with your Zabbix plug-in configuration, please check the browser debug mode to see the console log
650) this.width=650; "src=" http://ww1.sinaimg.cn/large/65b71c64gw1eu15k1f236j21080hqad3.jpg "style=" border:0px; margin:0px auto;padding:5px 0px; "alt=" 65b71c64gw1eu15k1f236j21080hqad3.jpg "/>
Add a good template as follows
650) this.width=650; "src=" http://ww1.sinaimg.cn/large/65b71c64gw1eu15k261v8j211t0madn1.jpg "style=" border:0px; margin:0px auto;padding:5px 0px; "alt=" 65b71c64gw1eu15k261v8j211t0madn1.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/BD/wKiom1WnCjrj_ziRAAasU2fZcDo584.jpg "title=" 3.png " alt= "Wkiom1wncjrj_ziraaasu2fzcdo584.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/BD/wKiom1WnC6WB_rDkAAbmrf8p-80625.jpg "title=" 4.png " alt= "Wkiom1wnc6wb_rdkaabmrf8p-80625.jpg"/>
If you have questions, please refer to the official documentation for more information.
This article is from "Itnihao's operation and Maintenance Technology blog" blog, please be sure to keep this source http://itnihao.blog.51cto.com/1741976/1675178
Grafana-zabbix Installation Brief Tutorial