zabbix部署
zabbix部署
- 部署zabbix服务
- 被监测主机部署zabbix-agent2
使用版本
| 组件 | 版本 |
|---|---|
| centos | 7.9 |
| zabbix | 5.0 |
| php | 7.2.24 |
| MariaDB | 5.5.68 |
部署zabbix服务
关闭防火墙和selinux
[root@node ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@node ~]# getenforce
Disabled
获取zabbix的下载源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
这边其实清空缓存就可以了
[root@node ~]# yum clean all
[root@node ~]# yum makecache
用于多版本环境使用(安装software Collections,避免php多版本冲突)
[root@node ~]# yum install centos-release-scl -y
查看源信息,这里使用的是国外源,想使用国内更换为阿里源
[root@node ~]# cat /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1[root@node ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo[root@node ~]# cat /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
安装zabbix及配置mysql
[root@node ~]# yum install zabbix-server-mysql zabbix-agent -y
[root@node ~]# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y
[root@node ~]# yum install mariadb-server -y
[root@node ~]# systemctl enable --now mariadb
[root@node ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.Enter current password for root (enter for none):
OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.Remove anonymous users? [Y/n] Y... Success!Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y... Success!By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.Remove test database and access to it? [Y/n] y- Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.Reload privilege tables now? [Y/n] y... Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.Thanks for using MariaDB![root@node ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.68-MariaDB MariaDB ServerCopyright (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)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> create user zabbix@localhost identified by 'mysql123';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> exit;
Bye
[root@node ~]#
写入sql
[root@node ~]# zcat /usr/share/doc/zabbix-server-mysql-5.0.40/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
[root@node ~]# mysql -u zabbix -p zabbix
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -AWelcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 5.5.68-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [zabbix]>
MariaDB [zabbix]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| zabbix |
+--------------------+
2 rows in set (0.00 sec)MariaDB [zabbix]> use zabbix;
Database changed
MariaDB [zabbix]>
MariaDB [zabbix]> exit;
Bye
修改配置
[root@node ~]# vi /etc/zabbix/zabbix_server.conf
[root@node ~]# cat /etc/zabbix/zabbix_server.conf | grep DB | grep -Ev "^#|^$"
DBName=zabbix
DBUser=zabbix
DBPassword=mysql123
[root@node ~]# vi /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
[root@node ~]# grep "timezone" /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
[root@node ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
[root@node ~]#
网页查看http://ip/zabbix/setup.php

查看右面状态是否全为ok,若不是,检查相关配置

配置数据库信息

下来一直点到结束



用户名:Admin,密码:zabbix


被监测主机部署zabbix-agent2
zabbix-agent2是由go语言编写的。zabbix对时间要求比较高,所以需要做时间同步。
主机部署ntp服务,然后其他被监控主机(被节点)同步时间即可(如果是先有生产环境,再配置zabbix监控,可以反过来做。具体情况具体分析)
[root@node ~]# yum install ntpd -y
[root@node ~]# systemctl start ntpd
被节点操作
[root@node1 ~]# yum install ntpdate -y
[root@node1 ~]# ntpdate -d 服务端ip
安装zabbix-agent2
[root@node1 ~]# rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
[root@node1 ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
[root@node1 ~]# yum install zabbix-agent2
修改配置文件
[root@node1 ~]# grep -Ev "^$|^#" /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=主IP
ServerActive=主IP
Hostname=node1
Include=/etc/zabbix/zabbix_agent2.d/*.conf
ControlSocket=/tmp/agent.sock
[root@node1 ~]# systemctl start zabbix-agent2
测试连通性
[root@node ~]# yum install zabbix-get -y
[root@node ~]# zabbix_get -s '172.26.138.68' -p 10050 -k 'agent.ping'
1
页面乱码解决,执行完后刷新页面即可
[root@node ~]# yum install wqy-microhei-fonts -y
[root@node ~]# \cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
相关文章:
zabbix部署
zabbix部署 部署zabbix服务被监测主机部署zabbix-agent2 使用版本 组件版本centos7.9zabbix5.0php7.2.24MariaDB5.5.68 部署zabbix服务 关闭防火墙和selinux [rootnode ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemonLoaded: …...
深入理解Java源码:提升技术功底,深度掌握技术框架,快速定位线上问题
为什么要看源码: 1、提升技术功底: 学习源码里的优秀设计思想,比如一些疑难问题的解决思路,还有一些优秀的设计模式,整体提升自己的技术功底 2、深度掌握技术框架: 源码看多了,对于一个新技术…...
寒假前端第一次作业
1、用户注册: <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>用户注册</title> …...
【LabVIEW FPGA入门】创建第一个LabVIEW FPGA程序
本教程仅以compactRIO(FPGA-RT)举例 1.系统配置 1.1软件安装 FPGA-RT 1. LabVIEW Development System (Full or Professional) 2. LabVIEW Real-Time Module 3. LabVIEW FPGA Module 4. NI-RIO drivers 1.2硬件配置 1.使用线缆连接CompactRIO至主机…...
【STM32】STM32学习笔记-USART串口数据包(28)
00. 目录 文章目录 00. 目录01. 串口简介02. HEX数据包03. 文本数据包04. HEX数据包接收05. 文本数据包接收06. 预留07. 附录 01. 串口简介 串口通讯(Serial Communication)是一种设备间非常常用的串行通讯方式,因为它简单便捷,因此大部分电子设备都支持…...
Java网络爬虫--HttpClient
目录标题 技术介绍有什么优点?怎么在项目中引入? 请求URLEntityUtils 类GET请求带参数的GET请求POST请求 总结 技术介绍 HttpClient 是 Apache Jakarta Common 下的子项目,用来提供高效的、功能丰富的、支持 HTTP 协议的客户端编程工具包。相…...
若依项目的table列表中对每一个字段增加排序按钮(单体版和前后端分离版)
一、目标:每一个字段都添加上下箭头用来排序 只需要更改前端代码,不需要更改后端代码,后面会讲解原理 二、单体版实现方式: 1.在options中添加sortable:true 2.在需要排序的字段中添加sortable:true 三、前后端分离版 1.el-table上添加@sort-change=“handleSortChange”…...
Linux自动化部署脚本
1:最近项目部署比较频繁终于熬不住了 就有下面的这东西 #!/bin/sh #报错停止运行 set -e # 获取tomcat的PID TOMCAT_PID$(ps -ef | grep tomcat | grep -v grep | awk {print $2}) # tomcat的启动文件位置 START_TOMCAT/mnt/tomcat/bin/startup.sh # 项目文件部署位置 PROJECT…...
lvgl修改图片大小上限
在lvgl中读取图片文件时,被读取的图片具有上限,也就是2048像素。这会造成两个非预期的结果: 超过2048像素的部分会被裁去。表示图片的结构体lv_img_t中的w和h变量值是图片像素被2048求余。例如,当一个图片高为2048像素时…...
阻止持久性攻击改善网络安全
MITRE ATT&CK框架是一个全球可访问的精选知识数据库,其中包含基于真实世界观察的已知网络攻击技术和策略。持久性是攻击者用来访问系统的众多网络攻击技术之一;在获得初始访问权限后,他们继续在很长一段时间内保持立足点,以窃取数据、修改…...
MFC与Qt多个控件响应统一响应消息处理
就目前使用C开发框架来说,今天来讲述下MFC框架下与Qt框架下,如何让多个控件响应统一消息处理方法。 功能:假设有5个按钮,需要响应同一个处理函数,该如何实现呢? Qt方式 开发环境:win10 VS201…...
Camunda rest api鉴权
对于rest api 不能没有限制的任何人随意调用,需要提供账号信息。 一:工作流引擎增加过滤器 /*** 对/engine-rest/*进行鉴权,防止非法攻击* 客户端调用需要配置用户凭证否则报错401* camunda.bpm.client.basic-auth.username* camunda.bpm.cl…...
【PostgreSQL】在DBeaver中实现序列、函数、视图、触发器设计
【PostgreSQL】在DBeaver中实现序列、函数、触发器、视图设计 基本配置一、序列1.1、序列使用1.1.1、设置字段为主键,数据类型默认整型1.1.2、自定义序列,数据类型自定义 1.2、序列延申1.2.1、理论1.2.2、测试1.2.3、小结 二、函数2.1、SQL直接创建2.1.1…...
PyQt5-小总结
之前学习PyQt5,然后那段时间想做一个桌面小程序,后来由于学习内容较多就做了一小部分,但是可以进行页面跳转。大家如果是初学者对Python感兴趣而且刚学数据库时可以看看代码,可能会有点启发。 效果: 登录进来是这&…...
vue父组件给子组件传值,子组件不渲染的原因及解决方法
父组件传递给子组件的数据,如果是一个复杂对象(例如一个数组或对象),那么子组件只会监听对象的引用而不是对象的内容。这意味着当对象的内容发生变化时,子组件不会更新。 解决: 1、在子组件使用 watch 监听…...
【数据库】MySQL锁
一、锁的基本概念 1、锁的定义 锁是协调多个进程或线程并发访问数据库资源的一种机制。 MySQL中的锁是在服务器层或者存储引擎层实现的,保证了数据访问的一致性与有效性。但加锁是消耗资源的,锁的各种操作,包括获得锁、检测锁是否已解除、…...
mongodb学习篇
目录 前言基本概念数据库-database集合-collection文档-document 部署mongodblinux安装mongodbdocker安装mongodb MongoDB Shell (mongosh)命令行工具mongodb可视化-mongodb-compass、mongo-expressmongodb配置文件mongodb库、集合、文档库基本操作集合基本操作文档的增删改查C…...
kubernetes存储类迁移-备份恢复
背景介绍 kubernetes集群最开始使用了nfs作为存储,随着后续使用过程中数据量逐渐增加,nfs存储性能逐步出现不足,现增加了基于csi的分布式块存储后,需要对原有基于nfs存储类下的pv迁移到新的存储类下。 测试环境 k8s集群版本&am…...
python智能手机芯片
在未来,python智能手机芯片的发展方向可能包括以下几个方面: 强化处理能力:随着智能手机功能的不断扩展和用户需求的增加,处理器的性能需求也在不断提升。未来的python智能手机芯片可能会加强处理器的核心数量和频率,以…...
混淆技术概论
混淆技术概论 引言 在逆向工程领域,混淆技术是一种非常重要的技术手段,通过打破人们的思维惯性,使得逆向分析变得更加困难。本文将会介绍混淆技术的概念、分类及其应用,以及如何使用IPA Guard进行iOS IPA重签名。 混淆技术概述…...
AI Agent Harness Engineering 产品经理指南:如何定义智能体的“人设”与能力边界?
AI Agent Harness Engineering 产品经理指南:如何定义智能体的「人设」与能力边界 关键词:AI Agent、智能体管控工程(Harness Engineering)、产品经理、人设对齐、能力边界、智能体治理、生成式AI落地 摘要 随着生成式AI技术的成熟,AI Agent已经从概念验证阶段进入大规…...
如何安全备份微信聊天记录:PyWxDump工具使用全指南
如何安全备份微信聊天记录:PyWxDump工具使用全指南 【免费下载链接】PyWxDump 删库 项目地址: https://gitcode.com/GitHub_Trending/py/PyWxDump 你是否曾因误删重要微信对话而懊悔不已?是否想永久保存珍贵聊天记录却不知从何下手?Py…...
树莓派扩展板EYESPI Pi Beret:简化硬件连接,加速原型开发
1. 项目概述:为什么我们需要EYESPI Pi Beret?玩树莓派的朋友,尤其是喜欢捣鼓屏幕和传感器的,肯定都经历过那个阶段:面对一堆杜邦线,对照着屏幕驱动板的引脚定义,一个个数着树莓派的GPIO针脚&…...
gnamiblast-skill:基于技能化与管道化的智能文本处理工具解析
1. 项目概述与核心价值最近在GitHub上闲逛,又发现了一个挺有意思的项目,叫gabrivardqc123/gnamiblast-skill。光看这个名字,可能有点摸不着头脑,gnamiblast听起来像是个自造词,skill又指向了某种技能或功能。作为一名常…...
MQ-3与MiCS-5524气体传感器对比:从原理到实战的选型指南
1. 项目概述与核心价值在嵌入式开发、环境监测乃至一些创意DIY项目中,气体检测是一个常见且关键的需求。无论是为了安全预警(如天然气泄漏),还是进行环境质量评估(如VOC监测),选择一款合适的传感…...
云端生信分析:从零部署RStudio Server避坑指南
1. 为什么需要云端RStudio Server? 做生物信息分析的朋友们肯定深有体会,单细胞测序、转录组这些数据动辄几十GB,用自己电脑跑分析简直是折磨。我去年处理一个肝癌单细胞项目时,光是读取数据就卡了半小时,更别说后续的…...
基于SpringBoot的公司固定资产盘点系统毕设源码
博主介绍:✌ 专注于Java,python,✌关注✌私信我✌具体的问题,我会尽力帮助你。一、研究目的本研究旨在构建一个基于Spring Boot框架的公司固定资产盘点系统以解决传统资产管理方式中存在的效率低下问题。当前企业固定资产管理工作普遍面临数据采集繁琐、…...
开源监控自动化平台openclaw-lighthouse:从告警到自愈的智能运维实践
1. 项目概述:一个开源的“灯塔”式监控与自动化平台最近在梳理团队内部的监控和自动化工具链时,发现了一个挺有意思的开源项目,叫openclaw-lighthouse。这个名字本身就很有画面感,“openclaw”是开放的爪子,象征着抓取…...
雷达目标检测与成像算法实时实现【附代码】
✨ 长期致力于阵列雷达、多输入多输出、现场可编程门阵列、目标检测定位、高分辨成像研究工作,擅长数据搜集与处理、建模仿真、程序编写、仿真设计。 ✅ 专业定制毕设、代码 ✅ 如需沟通交流,点击《获取方式》 (1)相控阵和差波束目…...
三量子比特控制旋转门:挑战与创新协议设计
1. 三量子比特控制旋转门的核心挑战在量子计算领域,多量子比特门是实现复杂量子算法的关键构建模块。其中,三量子比特控制旋转门(C2Ry)作为一种基本的多量子比特操作,能够根据两个控制量子比特的状态对目标量子比特执行条件旋转,在…...
