Zabbix+Grafana

Zabbix + Grafana

l

zabbix 和grafana 配合一起使用

Grafana概述:

1.Grafana是一个开源指标分析和可视化套件。它最常用于可视化基础设施性能数据和应用程序分析的时间序列数据。

2.Grafana也应用于基它领域,包括工业传感器,家庭自动化,天气和过程控制。

3.当然作为IT工程师来讲,无非最关注的是如何把数据进行聚合后进行展示.

4.服务器性能数据、应用程序数据分析、elasticsearch、大数据分析数据等。

5.grafana支持在多种环境下安装,包括windows、centos、ubuntu、mac、docker等环境

Grafana 优点:

简单易用:Grafana具有友好的用户界面和交互式图形编辑工具,使得用户可以轻松创建自定义仪表盘。
多数据源支持:Grafana支持多种数据源,使得用户可以集中管理和展示不同数据源的监控数据。
大量插件和面板:Grafana拥有丰富的插件和预定义面板,提供各种可视化选项,满足不同需求。
社区支持和活跃度:Grafana拥有广泛的用户社区和活跃的开发者社区,提供大量的文档、示例和支持。

zabbix + grafana配置过程

可以浏览官网:https://grafana.com/

环境:

虚拟机版本 IP
centos8 192.168.136.140

1.导入GPG key

[root@server ~]# wget -q -O gpg.key https://rpm.grafana.com/gpg.key
[root@server ~]# sudo rpm --import gpg.key

2.创建一个grafana.repo 仓库文件

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

3.添加下面的内容到你的grafana.repo 仓库文件中

[root@server ~]# vim /etc/yum.repos.d/grafana.repo
[root@server ~]# cat /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
exclude=*beta* // 添加这行

[root@server ~]# yum clean all
[root@server ~]# yum makecache

安装grafana

[root@server ~]# yum list all | grep grafana
[root@server ~]# yum -y install grafana 

开启并且开机自启

[root@server yum.repos.d]# systemctl start grafana-server
[root@server yum.repos.d]# systemctl enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.
[root@server yum.repos.d]# ss -antl
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port   Process   
LISTEN    0         128                0.0.0.0:10050            0.0.0.0:*                
LISTEN    0         128                0.0.0.0:10051            0.0.0.0:*                
LISTEN    0         2048             127.0.0.1:9000             0.0.0.0:*                
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*                
LISTEN    0         100              127.0.0.1:25               0.0.0.0:*                
LISTEN    0         80                       *:3306                   *:*                
LISTEN    0         511                      *:80                     *:*                
LISTEN    0         128                   [::]:22                  [::]:*                
LISTEN    0         2048                     *:3000 (出现端口)                   *:*                
LISTEN    0         100                  [::1]:25                  [::]:*                


登入页面用3000端口
Zabbix+Grafana_第1张图片Zabbix+Grafana_第2张图片
安装zabbix 插件

[root@server ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
installing alexanderzobnin-zabbix-app @ 4.1.5
from: https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/4.1.5/download
into: /var/lib/grafana/plugins

✔ Installed alexanderzobnin-zabbix-app successfully 

Restart grafana after installing plugins . 

# 重启grafana
[root@server ~]# systemctl restart grafana-server

Zabbix+Grafana_第3张图片
Zabbix+Grafana_第4张图片
Zabbix+Grafana_第5张图片

Zabbix+Grafana_第6张图片

Zabbix+Grafana_第7张图片

[root@server ~]# ls /usr/local/apache/htdocs/zabbix/
api_jsonrpc.php     conf                         include         robots.txt
api_scim.php        data                         index_http.php  setup.php

Zabbix+Grafana_第8张图片返回上一级看到zabbix就添加成功了

  1. 在web端添加监控图表
    点击Dashboards
    Zabbix+Grafana_第9张图片Zabbix+Grafana_第10张图片Zabbix+Grafana_第11张图片选择zabbix
    Zabbix+Grafana_第12张图片Zabbix+Grafana_第13张图片Zabbix+Grafana_第14张图片
    Zabbix+Grafana_第15张图片

你可能感兴趣的:(zabbix,grafana)