4.配置文件
grafana默认配置文件/etc/grafana/grafana.ini,那下面我们就来看一下grafana的基础配置。
以下配置文件中,“;”注释的配置项表示默认值,如果需要修改请把“;”去除修改配置即可。
以下为主要配置文件:
##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
; app_mode = production
#实例名称,如要HOSTNAME 变量为空,默认就为主机名
; instance_name = ${HOSTNAME}
#################################### Paths #########################
# 默认数据库配置
# as seperate properties or as on string using the url propertie.
# Either "mysql", "postgres" or "sqlite3", it's your choice ;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
# 使用URL或以前的字段来配置数据库
# Example: mysql://user:secret@host:port/database
;url =
# For "postgres" only, either "disable", "require" or "verify-full"
;ssl_mode = disable
# 仅适用于sqlite3数据库。将存储数据库的文件路径
;path = grafana.db
#################################### Security ############
# Makes it possible to turn off alert rule execution. ;execute_alerts = true 5.数据源
Grafana支持以时间序列存储数据的相关数据源,每个数据源都有一个特定的查询编辑器,该编辑器针对特定数据源公开的功能进行自定义。
当前grafana支持以下数据源:Graphite、InfluxDB、OpenTSDB、Promethenus、Elasticsearch、CloudWatch。每个数据源的查询语言和功能是不同的,
Grafana可以将不同尖的数据合并到单个Dashboard中。但每个面板都要与属于特定组织的数据源相关联。换句话说就是每个panel只能使用属于当前组织的数据源。 由于我这里使用的是zabbix作为数据源,所以暂且不介绍其他的数据源 安装Grafana-Zabbix
cd /var/lib/grafana/plugins
git clone https://github.com/alexanderzobnin/grafana-zabbix-app
然后重新启动grafana服务器。使用这种方式,您可以轻松升级插件
cd /var/lib/grafana/plugins/grafana-zabbix-app git pull service grafana-server restart
zabbix图形要显示在前端用granfa 调用zabbix 接口 打开Grafana界面 3000端口,更新Zabbix插件