传送门:
Zabbix的Server端的源码安装: //www.greatytc.com/p/a861afe42394
LNMP的源码安装: //www.greatytc.com/p/4699bcb04633
Zabbix-3.0的Agent端在CentOS 7.3的源码安装实践: //www.greatytc.com/p/2e4c535ca53a
脚本部署zabbix_agentd: //www.greatytc.com/p/88f079c334ce
用Grafana让zabbix绘图更炫酷://www.greatytc.com/p/5eddf0f0ed64
Grafana 是 Graphite 和 InfluxDB 仪表盘和图形编辑器。
Grafana 是开源的,功能齐全的度量仪表盘和图形编辑器,支持 Graphite,InfluxDB 和 OpenTSDB。Grafana 主要特性:灵活丰富的图形化选项;可以混合多种风格;支持白天和夜间模式;多个数据源。
一、配置数据库
[root@zabbix ~]# mysql -u grafana -h 127.0.0.1 -p
mysql> create database grafana character set utf8 collate utf8_bin;
mysql> CREATE TABLE`session` ( `key` CHAR(16) NOT NULL, `data` BLOB, `expiry` INT(11) UNSIGNED NOT NULL, \
PRIMARY KEY (`key`) ) ENGINE=MyISAM, DEFAULT CHARSET=utf8;
mysql> grant all on grafana.* to grafana@'localhost' identified by 'ibelieveicanfly'
mysql> \q
二、安装Grafana
下载地址:https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1-1470047149.x86_64.rpm
[root@zabbix ~]# yum -y install grafana-3.1.1-1470047149.x86_64.rpm
安装包详细信息
► 二进制文件 /usr/sbin/grafana-server
► 服务管理脚本 /etc/init.d/grafana-server
► 安装默认文件 /etc/sysconfig/grafana-server
► 配置文件 /etc/grafana/grafana.ini
► 安装systemd服务(如果systemd可用 grafana-server.service
► 日志文件 /var/log/grafana/grafana.log
► 缺省配置指定一个数据库sqlite3 /var/lib/grafana/grafana.db
启动Grafana
[root@zabbix ~]# service grafana-server start
设置garfana-server开机自启
[root@zabbix ~]# chkconfig grafana-server on
启动服务器(通过systemd)
[root@zabbix ~]# systemctl daemon-reload
[root@zabbix ~]# systemctl start grafana-server
[root@zabbix ~]# systemctl status grafana-server
设置开机自启systemd服务
[root@zabbix ~]# systemctl enable grafana-server.service
地址栏输入:http://IP:3000/login
默认用户和密码:admin admin
三、使用grafana-cli工具安装插件
[root@zabbix ~]# grafana-cli plugins list-remote
id: abhisant-druid-datasource version: 0.0.4
id: adremsoft-netcrunch-app version: 1.0.0
id: alexanderzobnin-zabbix-app version: 3.3.0
id: belugacdn-app version: 1.2.0
id: bessler-pictureit-panel version: 1.0.0
id: bosun-app version: 0.0.28
id: briangann-datatable-panel version: 0.0.1
id: briangann-gauge-panel version: 0.0.3
id: btplc-alarm-box-panel version: 0.0.3
id: btplc-peak-report-panel version: 0.0.3
id: btplc-trend-box-panel version: 0.0.3
id: btplc-trend-dot-panel version: 0.0.3
id: cloudflare-app version: 0.1.1
id: crate-datasource version: 0.5.1
id: digiapulssi-breadcrumb-panel version: 1.0.0
id: digiapulssi-organisations-panel version: 1.0.0
id: fastweb-openfalcon-datasource version: 1.0.0
id: fetzerch-sunandmoon-datasource version: 0.1.2
id: foursquare-clouderamanager-datasource version: 0.9.2
id: grafana-clock-panel version: 0.0.9
id: grafana-example-app version: 1.0.1
id: grafana-influxdb-08-datasource version: 1.0.2
id: grafana-kairosdb-datasource version: 2.0.1
id: grafana-piechart-panel version: 1.1.4
id: grafana-simple-json-datasource version: 1.3.1
id: grafana-worldmap-panel version: 0.0.16
id: gridprotectionalliance-openhistorian-datasource version: 1.0.1
id: gridprotectionalliance-osisoftpi-datasource version: 1.0.1
id: hawkular-datasource version: 1.0.7
id: jdbranham-diagram-panel version: 1.4.0
id: kentik-app version: 1.2.3
id: monasca-datasource version: 1.0.0
id: monitoringartist-monitoringart-datasource version: 1.0.0
id: mtanda-google-calendar-datasource version: 1.0.0
id: mtanda-heatmap-epoch-panel version: 0.1.7
id: mtanda-histogram-panel version: 0.1.6
id: natel-discrete-panel version: 0.0.4
id: natel-influx-admin-panel version: 0.0.2
id: natel-plotly-panel version: 0.0.3
id: neocat-cal-heatmap-panel version: 0.0.3
id: ns1-app version: 0.0.5
id: opennms-datasource version: 2.1.0
id: percona-percona-app version: 1.0.0
id: praj-ams-datasource version: 1.0.1
id: rackerlabs-blueflood-datasource version: 0.0.2
id: raintank-kubernetes-app version: 0.0.7
id: raintank-snap-app version: 0.0.5
id: raintank-worldping-app version: 1.2.3
id: ryantxu-ajax-panel version: 0.0.2
id: satellogic-3d-globe-panel version: 0.1.0
id: savantly-heatmap-panel version: 0.1.0
id: sileht-gnocchi-datasource version: 1.0.6
id: sni-pnp-datasource version: 1.0.1
id: stagemonitor-elasticsearch-app version: 0.26.0
id: udoprog-heroic-datasource version: 0.1.0
id: vertamedia-clickhouse-datasource version: 0.0.1
id: vonage-status-panel version: 1.0.3
id: voxter-app version: 0.0.1
Restart grafana after installing plugins . <service grafana-server restart>
[root@zabbix ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
installing alexanderzobnin-zabbix-app @ 3.3.0
from url: https://grafana.net/api/plugins/alexanderzobnin-zabbix-app/versions/3.3.0/download
into: /var/lib/grafana/plugins
? Installed alexanderzobnin-zabbix-app successfully
Restart grafana after installing plugins . <service grafana-server restart>
[root@zabbix ~]# grafana-cli plugins install grafana-piechart-panel
installing grafana-piechart-panel @ 1.1.4
from url: https://grafana.net/api/plugins/grafana-piechart-panel/versions/1.1.4/download
into: /var/lib/grafana/plugins
? Installed grafana-piechart-panel successfully
Restart grafana after installing plugins . <service grafana-server restart>
四、添加新的图形面板到仪表板
Datasource--+New
三--Add Panel--Graph
(Grafana支持只绘制一个监控项,也支持绘制多个监控项)
保存创建的仪表盘
Manage Dashboard--Save As--Save
插件链接:https://github.com/grafana/grafana
安装Panel
使用grafana-cli工具在命令行下面安装Clock
grafana-cli plugins install grafana-clock-panel
安装apps,Worldping
grafana-cli plugins install raintank-worldping-app
安装Data source,以SimpleJson为例
grafana-cli plugins install grafana-simple-json-datasource
安装完成,提示重启grafana服务
/etc/init.d/grafana-server restart
插件使用及仪表板模板导入
到此grafana-zabbix安装及使用完成。
官方地址:http://docs.grafana-zabbix.org
项目Demo:http://play.grafana.org/
项目github:https://github.com/grafana/grafana