#
#grafana 官方文档:http://docs.grafana.org/installation/rpm/
#
#安装grafana
[root@node2 ~]# yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x86_64.rpm
#安装zabbix
#启动服务
[root@node2 ~]# systemctl start grafana-server.service [root@node2 ~]# netstat -lntup | grep grafanatcp6 0 0 :::3000 :::* LISTEN 3259/grafana-server [root@node2 ~]# rpm -qc grafana /etc/init.d/grafana-server/etc/sysconfig/grafana-server/usr/lib/systemd/system/grafana-server.service[root@node2 ~]#
#访问 默认账户:admin 默认密码:admin
#登陆
#查找官方插件
root@node2 ~]# grafana-cli plugins list-removeGrafana cli plugins: 'list-remove' is not a Grafana cli plugins command. See 'grafana-cli --help'.[root@node2 ~]# grafana-cli plugins list-remoteid: abhisant-druid-datasource version: 0.0.4id: adremsoft-netcrunch-app version: 1.0.0id: alexanderzobnin-zabbix-app version: 3.3.0id: belugacdn-app version: 1.2.0id: bessler-pictureit-panel version: 1.0.0id: bosun-app version: 0.0.28id: briangann-datatable-panel version: 0.0.1id: briangann-gauge-panel version: 0.0.3id: btplc-alarm-box-panel version: 0.0.3id: btplc-peak-report-panel version: 0.0.3id: btplc-trend-box-panel version: 0.0.3id: btplc-trend-dot-panel version: 0.0.3id: cloudflare-app version: 0.1.1id: crate-datasource version: 0.5.1id: digiapulssi-breadcrumb-panel version: 1.0.0id: digiapulssi-organisations-panel version: 1.0.0id: fastweb-openfalcon-datasource version: 1.0.0id: fetzerch-sunandmoon-datasource version: 0.1.2id: foursquare-clouderamanager-datasource version: 0.9.2id: grafana-clock-panel version: 0.0.9id: grafana-example-app version: 1.0.1id: grafana-influxdb-08-datasource version: 1.0.2id: grafana-kairosdb-datasource version: 2.0.1id: grafana-piechart-panel version: 1.1.4id: grafana-simple-json-datasource version: 1.3.1id: grafana-worldmap-panel version: 0.0.17id: gridprotectionalliance-openhistorian-datasource version: 1.0.1id: gridprotectionalliance-osisoftpi-datasource version: 1.0.1id: hawkular-datasource version: 1.0.7id: jdbranham-diagram-panel version: 1.4.0id: kentik-app version: 1.2.3id: monasca-datasource version: 1.0.0id: monitoringartist-monitoringart-datasource version: 1.0.0id: mtanda-google-calendar-datasource version: 1.0.0id: mtanda-heatmap-epoch-panel version: 0.1.7id: mtanda-histogram-panel version: 0.1.6id: natel-discrete-panel version: 0.0.4id: natel-influx-admin-panel version: 0.0.2id: natel-plotly-panel version: 0.0.3id: neocat-cal-heatmap-panel version: 0.0.3id: ns1-app version: 0.0.5id: opennms-datasource version: 2.1.0id: percona-percona-app version: 1.0.0id: praj-ams-datasource version: 1.0.1id: rackerlabs-blueflood-datasource version: 0.0.2id: radensolutions-netxms-datasource version: 1.0.0id: raintank-kubernetes-app version: 0.0.7id: raintank-snap-app version: 0.0.5id: raintank-worldping-app version: 1.2.3id: ryantxu-ajax-panel version: 0.0.2id: satellogic-3d-globe-panel version: 0.1.0id: savantly-heatmap-panel version: 0.1.0id: sileht-gnocchi-datasource version: 1.0.6id: sni-pnp-datasource version: 1.0.1id: stagemonitor-elasticsearch-app version: 0.26.0id: udoprog-heroic-datasource version: 0.1.0id: vertamedia-clickhouse-datasource version: 0.0.1id: vonage-status-panel version: 1.0.4id: voxter-app version: 0.0.1Restart grafana after installing plugins .[root@node2 ~]#
#插件安装方法 参考:http://docs.grafana-zabbix.org/installation/
#安装插件 (国内网络原因,下载的速度非常慢,不建议用此方法)
[root@node2 ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
#安装插件 (建议用此方法,此方法速度也慢,但还能接受.....)
[root@node2 ~]# cd /var/lib/grafana/plugins[root@node2 plugins]# ls[root@node2 plugins]# yum install -y git[root@node2 plugins]# git clone https://github.com/alexanderzobnin/grafana-zabbixCloning into 'grafana-zabbix'...remote: Counting objects: 3984, done.remote: Total 3984 (delta 0), reused 0 (delta 0), pack-reused 3984Receiving objects: 100% (3984/3984), 2.02 MiB | 16.00 KiB/s, done.Resolving deltas: 100% (2595/2595), done.[root@node2 plugins]# lsgrafana-zabbix[root@node2 plugins]#
#重启服务
[root@node2 ~]# systemctl restart grafana-server.service
#登陆
#打开zabbix 插件
#enable插件
#添加数据源
#url 为zabbix全路径 +api_jsonrpc.php
#Usrename 为 zabbix 登陆账户
#Password 为zabbix 登陆密码
#参考:http://docs.grafana-zabbix.org/installation/configuration/
#添加成功
#查看现在有模板
#模板一
#模板二
#模板二
#新建图形 参考:
#单击 panel Title
#选择panel data source
#新建图形
#grafana 头丰富的插件,图形,可以对zabiix的图形不足加以补充