zabbix监控mariadb

2024-05-14 09:12
文章标签 监控 zabbix mariadb

本文主要是介绍zabbix监控mariadb,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

zabbix 服务端安装请参阅:红帽 9 zabbix 安装流程_红帽安装zabbix-CSDN博客

源码包安装mariadb请参阅:源码包安装mariadb_mariadb 11 源码编译安装-CSDN博客

  • 在MariaDB中,你需要创建一个专门的用户,用于Zabbix进行监控。这个用户需要有足够的权限来查询数据库的状态和性能信息。

创建一个新用户
[root@localhost ~]# /usr/local/mysql/bin/mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.6.17-MariaDB Source distributionCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> 
MariaDB [(none)]> 
MariaDB [(none)]> create user 'mariadb'@'%' identified by '1';
Query OK, 0 rows affected (0.008 sec)MariaDB [(none)]> grant replication client,process,show databases,show view on *.* to 'mariadb'@'%';
Query OK, 0 rows affected (0.001 sec)MariaDB [(none)]> 
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> exit
Bye
安装zabbix Agent
[root@localhost ~]# systemctl  stop firewalld.service 
[root@localhost ~]# systemctl  disable firewalld.service 
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
[root@localhost ~]# 
[root@localhost ~]# setenforce  0
[root@localhost ~]# sed  -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config 
[root@localhost ~]# 
[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.0UftJZ: Header V4 RSA/SHA512 Signature, key ID 08efa7dd: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...1:zabbix-release-6.4-1.el9         ################################# [100%]
[root@localhost ~]# dnf clean all
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.13 files removed
[root@localhost ~]# yum -y install  zabbix-agent
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.aa                                                                                                                               241 MB/s | 6.3 MB     00:00    
bb                                                                                                                               133 MB/s | 1.7 MB     00:00    
Zabbix Official Repository - x86_64                                                                                               13 kB/s | 236 kB     00:17    
Zabbix Official Repository non-supported - x86_64                                                                                150  B/s | 1.1 kB     00:07    
Dependencies resolved.
=================================================================================================================================================================Package                                Architecture                     Version                                          Repository                        Size
=================================================================================================================================================================
Installing:zabbix-agent                           x86_64                           6.4.14-release1.el9                              zabbix                           560 kTransaction Summary
=================================================================================================================================================================
Install  1 PackageTotal download size: 560 k
Installed size: 2.4 M
Downloading Packages:
zabbix-agent-6.4.14-release1.el9.x86_64.rpm                                                                                       11 kB/s | 560 kB     00:50    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                             11 kB/s | 560 kB     00:50     
Zabbix Official Repository - x86_64                                                                                              3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0x08EFA7DD:Userid     : "Zabbix LLC (Jul 2022) <packager@zabbix.com>"Fingerprint: D9AA 84C2 B617 479C 6E4F CF4D 19F2 4753 08EF A7DDFrom       : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-08EFA7DD
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing        :                                                                                                                                         1/1 Running scriptlet: zabbix-agent-6.4.14-release1.el9.x86_64                                                                                                 1/1 Installing       : zabbix-agent-6.4.14-release1.el9.x86_64                                                                                                 1/1 Running scriptlet: zabbix-agent-6.4.14-release1.el9.x86_64                                                                                                 1/1 Verifying        : zabbix-agent-6.4.14-release1.el9.x86_64                                                                                                 1/1 
Installed products updated.Installed:zabbix-agent-6.4.14-release1.el9.x86_64                                                                                                                        Complete!
[root@localhost ~]#

修改agent配置文件

[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf 
117 Server=192.168.200.133                  //此两行修改为服务端的IP地址
171 ServerActive=192.168.200.133
[root@localhost ~]# systemctl  restart  zabbix-agent.service 
[root@localhost ~]# systemctl  enable  zabbix-agent.service 
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
[root@localhost ~]# 

在服务端上添加mariadb主机

 

 

 

 

 

 

 

这篇关于zabbix监控mariadb的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/988356

相关文章

k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)

《k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)》本文记录在K8s上运行的MySQL/MariaDB备份方案,通过工具容器执行mysqldump,结合定时任务实... 目录前言一、获取需要备份的数据库的信息二、备份步骤1.准备工作(X86)1.准备工作(arm)2.手

JVisualVM之Java性能监控与调优利器详解

《JVisualVM之Java性能监控与调优利器详解》本文将详细介绍JVisualVM的使用方法,并结合实际案例展示如何利用它进行性能调优,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全... 目录1. JVisualVM简介2. JVisualVM的安装与启动2.1 启动JVisualVM2

使用Python实现实时金价监控并自动提醒功能

《使用Python实现实时金价监控并自动提醒功能》在日常投资中,很多朋友喜欢在一些平台买点黄金,低买高卖赚点小差价,但黄金价格实时波动频繁,总是盯着手机太累了,于是我用Python写了一个实时金价监控... 目录工具能干啥?手把手教你用1、先装好这些"食材"2、代码实现讲解1. 用户输入参数2. 设置无头浏

使用Python实现IP地址和端口状态检测与监控

《使用Python实现IP地址和端口状态检测与监控》在网络运维和服务器管理中,IP地址和端口的可用性监控是保障业务连续性的基础需求,本文将带你用Python从零打造一个高可用IP监控系统,感兴趣的小伙... 目录概述:为什么需要IP监控系统使用步骤说明1. 环境准备2. 系统部署3. 核心功能配置系统效果展

AJAX请求上传下载进度监控实现方式

《AJAX请求上传下载进度监控实现方式》在日常Web开发中,AJAX(AsynchronousJavaScriptandXML)被广泛用于异步请求数据,而无需刷新整个页面,:本文主要介绍AJAX请... 目录1. 前言2. 基于XMLHttpRequest的进度监控2.1 基础版文件上传监控2.2 增强版多

Linux使用nload监控网络流量的方法

《Linux使用nload监控网络流量的方法》Linux中的nload命令是一个用于实时监控网络流量的工具,它提供了传入和传出流量的可视化表示,帮助用户一目了然地了解网络活动,本文给大家介绍了Linu... 目录简介安装示例用法基础用法指定网络接口限制显示特定流量类型指定刷新率设置流量速率的显示单位监控多个

通过prometheus监控Tomcat运行状态的操作流程

《通过prometheus监控Tomcat运行状态的操作流程》文章介绍了如何安装和配置Tomcat,并使用Prometheus和TomcatExporter来监控Tomcat的运行状态,文章详细讲解了... 目录Tomcat安装配置以及prometheus监控Tomcat一. 安装并配置tomcat1、安装

C#实现系统信息监控与获取功能

《C#实现系统信息监控与获取功能》在C#开发的众多应用场景中,获取系统信息以及监控用户操作有着广泛的用途,比如在系统性能优化工具中,需要实时读取CPU、GPU资源信息,本文将详细介绍如何使用C#来实现... 目录前言一、C# 监控键盘1. 原理与实现思路2. 代码实现二、读取 CPU、GPU 资源信息1.

使用zabbix进行监控网络设备流量

《使用zabbix进行监控网络设备流量》这篇文章主要为大家详细介绍了如何使用zabbix进行监控网络设备流量,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录安装zabbix配置ENSP环境配置zabbix实行监控交换机测试一台liunx服务器,这里使用的为Ubuntu22.04(

springboot健康检查监控全过程

《springboot健康检查监控全过程》文章介绍了SpringBoot如何使用Actuator和Micrometer进行健康检查和监控,通过配置和自定义健康指示器,开发者可以实时监控应用组件的状态,... 目录1. 引言重要性2. 配置Spring Boot ActuatorSpring Boot Act