[grafana]-grafana6.2配合显示zabbix4.2

安装grafana

wget https://dl.grafana.com/oss/release/grafana-6.2.0-1.x86_64.rpm 

yum localinstall grafana-6.2.0-1.x86_64.rpm -y

systemctl stop firewalld.service

systemctl disable firewalld.service

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

setenforce 0

使用命令行安装

grafana-cli plugins install alexanderzobnin-zabbix-app

或者点击zabbix 会提示安装命令的

 

如果不设置数据库  创建zabbix Data Sources只会显示下面的界面

很多博客都是抄来抄去,结果都没有叫我安装数据库。导致setting下面配置信息都没有。

 

 

 

先安装mysql(自行安装了5.7)

安装完成之后登录数据库

 

#创建数据库

CREATE DATABASE IF NOT EXISTS grafana DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

#创建用户

create user grafana@'%' IDENTIFIED by 'grafana';

#授权

grant all privileges on grafana.* to grafana@localhost identified by 'grafana';

#刷新权限表

flush privileges;

 

修改/etc/grafana/grafana.ini    将数据库替换成mysql 如下

 

[database]

# You can configure the database connection by specifying type, host, name, user and password

# as separate properties or as on string using the url properties.

 

# Either "mysql", "postgres" or "sqlite3", it's your choice

type = mysql

host = 127.0.0.1:3306

name = grafana

user = root

# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""

password = Hangzhou@123

 

 

上面我没有用创建的数据库用户,因为懒。哈哈  大家可以用上面创建的普通用户,比较安全

 

重启grafana

systemctl restart  grafana-server.service

 

配置grafana数据源

填写信息

 

 

 

 

 

 

 

 

 

 

图表

双击table选项

下拉选项 选择Edit

再Edit

 

添加数据源和数据

 

 

这样数据是轮询的   看起来很挫

 

修改Table Transform 为time series aggregations

将值从平均值 修改为当前值。

 

修改列名  原先列名叫Metric

修改列名  原先列名叫Current

 

根据需求设置阈值和颜色

 

 

仪表盘

同样道理创建一个仪表盘视图 

 

 

 

 

图形

6版本的grafana没有Display选项了 直接在最前面显示了

 

 

 

反转

 

 

 

最后七七八八弄弄暂时弄成下面这样了吧

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爷来辣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值