当前位置: 首页 > news >正文

zabbix监控Linux系统

1. zabbix agent安装

#sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-4.el8.noarch.rpm
#sudo dnf clean all
#yum install zabbix-agent  -y
Running transaction test
Transaction test succeeded.
Running transactionPreparing        :                                                                                                                                           1/1Running scriptlet: zabbix-agent-6.0.35-release1.el8.x86_64                                                                                                   1/1Installing       : zabbix-agent-6.0.35-release1.el8.x86_64                                                                                                   1/1Running scriptlet: zabbix-agent-6.0.35-release1.el8.x86_64                                                                                                   1/1
[/usr/lib/tmpfiles.d/pesign.conf:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop-in file accordingly.Verifying        : zabbix-agent-6.0.35-release1.el8.x86_64                                                                                                   1/1Installed:zabbix-agent-6.0.35-release1.el8.x86_64

2. zabbix agent配置文件

[root@CentOS8 yum.repos.d]# cat /etc/zabbix/zabbix_agentd.conf | egrep -v "^$|^#"
# 被动检查相关配置
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.211.55.13ListenPort=10050StartAgents=3
Hostname=10.211.55.10
Include=/etc/zabbix/zabbix_agentd.d/*.conf

3. 重启zabbix agent

[root@CentOS8 yum.repos.d]# systemctl  restart zabbix-agent.service
[root@CentOS8 yum.repos.d]# systemctl  status zabbix-agent.service
● zabbix-agent.service - Zabbix AgentLoaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)Active: active (running) since Tue 2024-07-09 20:37:01 CST; 5s agoProcess: 55029 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)Main PID: 55031 (zabbix_agentd)Tasks: 6 (limit: 4922)Memory: 3.6MCGroup: /system.slice/zabbix-agent.service├─55031 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf├─55032 /usr/sbin/zabbix_agentd: collector [idle 1 sec]├─55033 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]├─55034 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]├─55035 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]└─55036 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]Jul 09 20:37:01 CentOS8.5-epbf systemd[1]: Starting Zabbix Agent...
Jul 09 20:37:01 CentOS8.5-epbf systemd[1]: Started Zabbix Agent.

4. 验证zabbix agent

验证zabbix-agent进程是否存在,端口是否监听以及日志是否有异常

[root@CentOS8 yum.repos.d]# ps -ef| grep zabbix
zabbix     55031       1  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix     55032   55031  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix     55033   55031  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix     55034   55031  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix     55035   55031  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix     55036   55031  0 20:37 ?        00:00:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root       55040   21425  0 20:37 pts/0    00:00:00 grep --color=auto zabbix
[root@CentOS8 yum.repos.d]# pstree -p 55031
zabbix_agentd(55031)-+-zabbix_agentd(55032)|-zabbix_agentd(55033)|-zabbix_agentd(55034)|-zabbix_agentd(55035)`-zabbix_agentd(55036)
[root@CentOS8 yum.repos.d]# ss -tnl| grep 10050
LISTEN 0      128          0.0.0.0:10050      0.0.0.0:*
LISTEN 0      128             [::]:10050         [::]:*
[root@CentOS8 yum.repos.d]# tail -n5 /var/log/zabbix/zabbix_agentd.log55034:20240709:203701.448 agent #3 started [listener #2]55036:20240709:203701.449 agent #5 started [active checks #1]55035:20240709:203701.449 agent #4 started [listener #3]

5. zabbix web添加被监控主机

在这里插入图片描述

6. 验证主机监控数据

在这里插入图片描述

在这里插入图片描述

http://www.lryc.cn/news/482645.html

相关文章:

  • 线性表-数组描述补充 迭代器(C++)
  • vue3 + element-plus 的 upload + axios + django 文件上传并保存
  • dm 创建数据库实例【window】
  • Docker实践与应用举例:从入门到进阶
  • 【LeetCode】【算法】560. 和为 K 的子数组
  • Webots控制器编程
  • 舷外机,高效动力的选择,可靠性能的保障_鼎跃安全
  • 计算机新手练级攻略——如何搜索问题
  • echarts-gl 3D柱状图配置
  • 设计模式之模版方法模式(Template)
  • 背包九讲——背包问题求具体方案
  • Python http打印(http打印body)flask demo(http调试demo、http demo、http printer)
  • JSF HTML标签教程一口气讲完!(下)
  • cmake报错The link interface of target “gRPC::grpc“ contains: OpenSSL::SSL 解决
  • C语言PythonBash:空白(空格、水平制表符、换行符)与转义字符
  • 【Python】轻松解析JSON与XML:Python标准库的json与xml模块
  • 物联网对商业领域的影响
  • 第16章 SELECT 底层执行原理
  • python查询日志,并组装sql,修复缺失的数据
  • RecyclerView进阶知识讲解
  • C语言 函数
  • windows中docker安装redis和redisinsight记录
  • itextpdf打印A5的问题
  • qt QUndoView详解
  • python+智谱AI-实现钉钉消息自动回复
  • Kafka-Eagle的配置——kafka可视化界面
  • 【命令操作】Linux上带宽流量监控nethogs命令详解 _ 统信 _ 麒麟 _ 方德
  • 【入门篇】数字统计——多语言版
  • 探索那些现代C++语法糖
  • 【LeetCode】【算法】33. 搜索旋转排序数组