目 录CONTENT

文章目录

zabbix与grafana结合

ZiChen D
2021-10-08 / 0 评论 / 1 点赞 / 273 阅读 / 4,063 字 / 正在检测是否收录...

Grafana介绍

Grafana是一个跨平台的开源的度量分析和可视化工具,可以通过将采集的数据查询然后可视化的展示,并及时通知。它主要有以下六大特点:

展示方式:快速灵活的客户端图表,面板插件有许多不同方式的可视化指标和日志,官方库中具有丰富的仪表盘插件,比如热图、折线图、图表等多种展示方式;
数据源:Graphite,InfluxDB,OpenTSDB,Prometheus,Elasticsearch,CloudWatch和KairosDB等;
通知提醒:以可视方式定义最重要指标的警报规则,Grafana将不断计算并发送通知,在数据达到阈值时通过Slack、PagerDuty等获得通知;
混合展示:在同一图表中混合使用不同的数据源,可以基于每个查询指定数据源,甚至自定义数据源;
注释:使用来自不同数据源的丰富事件注释图表,将鼠标悬停在事件上会显示完整的事件元数据和标记;
过滤器:Ad-hoc过滤器允许动态创建新的键/值过滤器,这些过滤器会自动应用于使用该数据源的所有查询

下载与安装

[root@localhost ~]# wget https://dl.grafana.com/oss/release/grafana-8.2.0-1.x86_64.rpm
--2021-10-08 12:53:47--  https://dl.grafana.com/oss/release/grafana-8.2.0-1.x86_64.rpm
正在解析主机 dl.grafana.com (dl.grafana.com)... 151.101.42.217, 2a04:4e42:a::729
正在连接 dl.grafana.com (dl.grafana.com)|151.101.42.217|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:66080608 (63M) [application/x-redhat-package-manager]
正在保存至: “grafana-8.2.0-1.x86_64.rpm”

grafana-8.2.0-1.x86_64.rpm                       100%[=======================================================================================================>]  63.02M  11.3MB/s  用时 6.9s    

2021-10-08 12:53:57 (9.07 MB/s) - 已保存 “grafana-8.2.0-1.x86_64.rpm” [66080608/66080608])

[root@localhost ~]# mv grafana-8.2.0-1.x86_64.rpm /usr/src/
[root@localhost ~]# cd /usr/src/
[root@localhost src]# ls
apr-1.7.0         apr-util-1.6.1         debug                       httpd-2.4.48         kernels                                     zabbix-5.4.4
apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  grafana-8.2.0-1.x86_64.rpm  httpd-2.4.48.tar.gz  mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz  zabbix-5.4.4.tar.gz

[root@localhost src]# yum -y  install grafana-8.2.0-1.x86_64.rpm
[root@localhost src]# systemctl daemon-reload
[root@localhost src]# systemctl start grafana-server
[root@localhost src]# systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.

[root@localhost src]# ss -anlt | grep *:3000
LISTEN    0         128                      *:3000                   *:*     

[root@localhost src]# grafana-cli plugins list-remote
id: xginn8-pagerduty-datasource version: 0.2.2
id: yesoreyeram-boomtable-panel version: 1.4.1
id: yesoreyeram-boomtheme-panel version: 0.1.1
id: yesoreyeram-infinity-datasource version: 0.7.8
id: yeya24-chaosmesh-datasource version: 0.2.2
id: zuburqan-parity-report-panel version: 1.2.2
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.

[root@localhost src]# grafana-cli plugins install alexanderzobnin-zabbix-app
✔ Downloaded alexanderzobnin-zabbix-app v4.2.4 zip successfully

Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.

[root@localhost src]# service grafana-server restart
Restarting grafana-server (via systemctl):                 [  OK  ]

Web界面操作
image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

1

评论区