zabbix+grafana

上传Grafana安装包或者下载rpm安装包到服务器,执行如下命令安装:

配置yum源

[root@localhost ~]# cat /etc/yum.repos.d/grafana.repo 
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm-beta
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

安装grafana

[root@localhost ~]# sudo yum -y install grafana

启动grafana-server

[root@localhost ~]# systemctl start grafana-server
[root@localhost ~]# systemctl status grafana-server
[root@localhost ~]# systemctl enable grafana-server

他的配置文件不需要修改
定义环境变量文件:/etc/sysconfig/grafana-server
/etc/sysconfig/grafana-server文件内容:
配置文件:/etc/grafana/grafana.ini

Paths配置段
#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
;data = /var/lib/grafana    # 默认存放数据位置
 
# Temporary files in `data` directory older than given duration will be removed
;temp_data_lifetime = 24h
# 删除 'data'目录给定时间前的临时文件,使用0则不删除临时文件,时间格式h,m。如168h,30m,10h30m
 
# Directory where grafana can store logs
;logs = /var/log/grafana # grafana存储日志的目录
 
# Directory where grafana will automatically scan and look for plugins
;plugins = /var/lib/grafana/plugins # grafana存放插件的目录
 
# folder that contains provisioning config files that grafana will apply on startup and while running.
;provisioning = conf/provisioning
 Server配置段
[server]
# Protocol (http, https, h2, socket)
;protocol = http  #支持的协议
 
# The ip address to bind to, empty will bind to all interfaces
;http_addr =  #服务监听的地址
 
# The http port  to use
;http_port = 3000  #监听的端口
 
# The public facing domain name used to access grafana from a browser
;domain = localhost   #使用域名访问服务
 
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false  #是否 强制使用域名访问服务
 
# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = %(protocol)s://%(domain)s:%(http_port)s/   #定义访问服务的路径
 
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false
 
# Log web requests  #是否记录web请求
;router_logging = false
 
# the path relative working path  #定义静态文件的访问路径
;static_root_path = public
 
# enable gzip  #是否开启压缩
;enable_gzip = false
 
# https certs & key file   #证书文件
;cert_file =
;cert_key =
 
# Unix socket path  #定义socket路径
;socket =

grafana默认登录的管理员账号密码都是:admin
改变默认登录 密码!,然后进入系统
添加数据源
在这里插入图片描述
添加zabbix 作为数据源
在这里插入图片描述
安装zabbix 插件点击如图所示
在这里插入图片描述
在这里插入图片描述
复制图中代码在xshell中进行操作
在这里插入图片描述

出现对号说明成功
在这里插入图片描述

重启服务

[root@localhost ~]# systemctl restart grafana-server.service

回到主页开启zabbix app
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
添加zabbix作为数据源

在这里插入图片描述
在这里插入图片描述
zabbix的用户名:Admin
zabbix的密码:zabbix
在这里插入图片描述
在这里插入图片描述
导入数据
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
最后保存仪表盘就可以了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值