首页 > 系统相关 >Linux-监控三剑客之Grafana

Linux-监控三剑客之Grafana

时间:2023-03-23 16:55:41浏览次数:50  
标签:plugins server Grafana zabbix Linux alexanderzobnin grafana root 三剑客

Grafana

一、环境准备

环境
zabbix-server zabbix服务端 10.0.0.62
grafana-server grafana服务端 10.0.0.63

二、使用流程

1.部署grafana 9.3.6

[root@grafana-server ~]# ll
total 119100
-rw-------. 1 root root     1340 Jan  9 09:09 anaconda-ks.cfg
-rw-r--r--  1 root root 88935132 Mar 21 08:16 grafana-9.3.6-1.x86_64.rpm
-rw-r--r--  1 root root 33016641 Mar 21 08:16 grafana-9.3.6-alexanderzobnin-zabbix-app-v4.2.10.tar.gz
#安装grafana
[root@grafana-server ~]# yum localinstall -y grafana-9.3.6-1.x86_64.rpm
#启动grafana
[root@grafana-server ~]# systemctl enable --now grafana-server.service
[root@grafana-server ~]# ss -lnutp|grep grafana
tcp    LISTEN     0      128    [::]:3000  [::]:*   users:(("grafana-server",pid=6046,fd=11))

#解压插件
[root@grafana-server ~]# tar xf grafana-9.3.6-alexanderzobnin-zabbix-app-v4.2.10.tar.gz 
[root@grafana-server ~]# ll
total 119104
drwxr-xr-x  7 root root     4096 Mar 20 21:42 alexanderzobnin-zabbix-app
#创建插件目录
[root@grafana-server ~]# mkdir -p /var/lib/grafana/plugins
[root@grafana-server ~]# mv alexanderzobnin-zabbix-app/ /var/lib/grafana/plugins
#重启grafana
[root@grafana-server ~]# systemctl restart grafana-server.service
#查看grafana插件
[root@grafana-server ~]# grafana-cli plugins ls
installed plugins:
alexanderzobnin-zabbix-app @ 4.2.10
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.

2.web页面访问

http://gra.cn:3000/

image-20230321194044830

3.简单配置

image-20230321194152103

image-20230321194218337

4. 配置zbx插件

image-20230321194330539

image-20230321194406180

image-20230321194414026

如果搜索不到zabbix表示没有安装对应的插件.

可以通过提供的软件包解压或者grafana-cli plugins install alexanderzobnin-zabbix-app安装.

5.配置grafana的数据源

image-20230321194512686

image-20230321194524046

image-20230321194648041

image-20230321194844750

image-20230321194934723

6.导入自带的几个仪表盘

image-20230321195417116

image-20230321195430819

image-20230321195446207

三、Grafana web页面添加与配置图形 dashboard

image-20230321195616432

1.修改主机名

image-20230321195707070

image-20230321195742450

image-20230321200011867

image-20230321200257299

image-20230321200457663

image-20230321200622527

2.修改显示cpu使用率

image-20230321200808923

3.修改显示uptime

image-20230321200855422

4.保存修改后的面板

image-20230321200919664

image-20230321200934727

image-20230321200942985

5.测试是否从zabbix获取值

image-20230321202052204

image-20230321202117202

image-20230321202132196

四、自定义监控获取zbx服务端的每秒新值

zabbix.stats键值的结果之一.

需要通过自定义监控创建1个监控项运行zabbix.stats键值.

创建相关项(监控项)对上面监控项结果进行过滤(sed反向引用).

1.定义监控项(主要项)

image-20230321201225204

image-20230321201347162

2.创建相关项

image-20230321201521775

image-20230321201630947

image-20230321201642209

image-20230321201733052

image-20230321201748548

image-20230321202233855

注意事项:

如果zabbix做了高可用,这里可能会有问题

image-20230321205707849

五、更完善的模板(仪表盘)

下载官方仪表盘https://grafana.com/grafana/dashboards/?plcmt=footer

1.下载模板

image-20230321204247524

image-20230321204317635

image-20230321204417646

image-20230321204446171

image-20230321204517672

image-20230321204532855

image-20230321204548739

2.配置模板可编辑

image-20230321204632527

image-20230321204643499

image-20230321204650848

image-20230321204700156

image-20230321204712713

image-20230321204735615

3.grafana仪表盘中变量的设置与修改

image-20230321204758534

image-20230321204917181

image-20230321204957032

image-20230321205027867

image-20230321205038623

image-20230321205049437

标签:plugins,server,Grafana,zabbix,Linux,alexanderzobnin,grafana,root,三剑客
From: https://www.cnblogs.com/world-of-yuan/p/17248056.html

相关文章

  • Linux-监控三剑客之Zabbix
    Zabbix一、Linux的常用的一些命令项目对应检查命令网站/业务/apicurl/wget服务systemctl/service/chkconfig(c6)进程ps/pstree/pgrep/pidstat/top/hto......
  • Linux 2.4G USB遥控板驱动
    #include<linux/kernel.h>#include<linux/slab.h>#include<linux/module.h>#include<linux/init.h>#include<linux/usb/input.h>#include<linux/hid.h>#include<lin......
  • Linux端口转发的几种常用方法
    在一些实际的场景里,我们需要通过利用一些端口转发工具,比如系统自带的命令行工具或第三方小软件,来绕过网络访问限制触及目标系统。本文总结了Linux端口转发的一些常用方法,欢......
  • Linux系统的六大特点,你知道几个?
    提到操作系统,大家肯定都知道Windows,其实Linux也是一个操作系统,与Windows不同的是,Linux是一套开放源代码程序的、可以自由传播的类Unix操作系统软件。以下是详细的内容:......
  • Oracle VM VirtualBox+vagrant搭建Linux虚拟机
    OracleVMVirtualBox+vagrant,搭建Linux虚拟机title:OracleVMVirtualBox+vagrant,搭建Linux虚拟机tags:-vm-vagrant-VirtualBoxcategories:-学习语录Ora......
  • Linux中给添加用户并创建该用户权限的文件夹
    在公司开发过程中经常会遇到在同一台编译机上给不同的用户创建权限等需求,在这里贴上相应的代码添加用户useradd-musername-ppassword-d/data/home/gengkaiyuuse......
  • linux系统内存溢出Out of memory
    有一台服务器的内存是32g,我在上面跑了一个mysql数据库,后面经常发现mysql隔三差五的就down了,通过查看系统日志发现操作系统OOM了grep"Outofmemory"/var/log/messages......
  • linux基本操作
    删除相同的行并且显示相同行出现的次数uniq-c排序sort:-n以数值排序防止出现1<10这种按字符比较的情况-t指定排序的分隔符-k指定按照第几列进行排序......
  • Linux 网络配置 ---桥接模式---最简单的方法!!!
    1.桥接模式(Bridged)VMware桥接模式,也就是将虚拟机的虚拟网络适配器与主机的物理网络适配器进行交接,虚拟机中的虚拟网络适配器可通过主机中的物理网络适配器直接访问到外部......
  • centos7 Linux 安装及升级node、npm
    centos7初始版本node6npm3 更新升级node版本#安装nnpminstall-gn#查看版本n--version//v9.0.1#把当前系统的Node更新成最新的“稳定版本”nstabl......