Grafana-zabbix is a plugin for Zabbix that renders cool charts by invoking API interfaces
System: Centos6.
1, installation Grafana
[Email protected] ~]# wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.2-1.x86_64.rpm
[Email protected] ~]# yum–y install grafana-2.0.2-1.x86_64.rpm
After installation there will be the following files
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
2. start grafana service
[[Email protected] ~]# service Grafana-serverstart
Starting Grafana Server: .... nohup:redirecting stderr to stdout
Ok
[Email protected] ~]# chkconfig--addgrafana-server
[Email protected] ~]# chkconfig Grafana-serveron
[Email protected] ~]# NETSTAT-ANPT | Grepgrafana
TCP 0 0::: +:::* LISTEN 15444/grafana-serve
TCP 0 0::ffff:172.16.112.110:3000:: ffff:172.16.113.23:60566 established 15444/grafana-serve
Nohup:redirectingstderr to stdout (the variable redirection of the startup script may be a bit wrong, but does not affect the opening of the service)
Service Details
Start User Grafana
Service Name grafana-server
default Port 3000
Account Admin
Password admin
3, Login Management interface ( to this grafana installation success)
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/E8/wKioL1XBd8eQtbZjAAFDdtnwDOQ848.jpg "title=" Login interface. jpg "alt=" wkiol1xbd8eqtbzjaafddtnwdoq848.jpg "/>
4. Install Grafana-zabbix plug-in
(You can also unzip the https://github.com/alexanderzobnin/grafana-zabbix/releases/tag/v2.0.1 after downloading the source package.) This uses the git clone command)
Https://github.com/alexanderzobnin/grafana-zabbix
[[email protected] ~]# yum-y install git
[[email protected] ~]# git clone https://github.com/alexanderzobnin/grafana-zabbix/
Initialized Empty Git repository in/root/grafana-zabbix/.git/
Remote:counting objects:955, done.
Remote:compressing objects:100% (18/18), done.
Remote:total 955 (delta), reused 0 (Delta 0), pack-reused 937
Receiving objects:100% (955/955), 176.96KiB | 159 kib/s, done.
Resolving deltas:100% (606/606), done.
[email protected] ~]# sudo cp-rgrafana-zabbix/zabbix//usr/share/grafana/public/app/plugins/datasource/
[email protected] ~]# 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": "Zabbix", # Configure user name, note that this user exists in Zabbix , and the Zabbix Data has read-only permission (no write permission required )
"Password": "Zabbix", # Configure secret code
"Trends": false,
"Trendsfrom": "7d",
"Limitmetrics": 100,
"Metrics": true,
"Annotations": True
}
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/E8/wKioL1XBd_mRLMu1AAAvS0Ffzxs263.jpg "title=" Zabbix.jpg "alt=" Wkiol1xbd_mrlmu1aaavs0ffzxs263.jpg "/>
5. Restart Service
[[Email protected] ~]# service Grafana-serverrestart
Okopping Grafana Server ... [OK]
Starting Grafana Server: nohup:redirecting stderr to stdout
Ok
Modify Zabbix of the API file, as Zabbix2.2 support cross-domain issues, so add the following configuration
#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
}
# Add (2.2 already there, without adding)
Require_once dirname (__file__). ' /include/func.inc.php ';
Require_oncedirname (__file__). ' /include/classes/core/chttprequest.php ';
6, configuration Grafana
Add Datasource Data Source
where http Settiong
usrl:http://172.16.112.110/zabbix/api_jsonrpc.php
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/EB/wKiom1XBdu2SVKXLAAIYozPQlzU736.jpg "title=" Zabbix data source. jpg "alt=" wkiom1xbdu2svkxlaaiyozpqlzu736.jpg "/>
7, Next is to add grafana graphics
Reference Https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/E8/wKioL1XBeKmBrKedAAUROQMShEo249.jpg "title=" Grafana.jpg "alt=" Wkiol1xbekmbrkedaauroqmsheo249.jpg "/>
This article is from "Meteor Yu" blog, please be sure to keep this source http://8789878.blog.51cto.com/8779878/1681800
Zabbix plug-in Grafana-zabbix implementation Cool chart