|NO.Z.00016|——————————|^^ 构建 ^^|——|Zabbix&Zabbix.Agent&Yum.V2|
一、安装zabbix-agent:
### --- 添加zabbix仓库:
[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
~~~ 把zabbix.repo文件里面的内容替换为以下内容:
[root@localhost ~]# cat>/etc/yum.repos.d/zabbix.repo<<EOF
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/zabbix/RPM-GPG-KEY-ZABBIX
gpgcheck=1
EOF
~~~ Zabbix前端需要基本安装中不提供的其他软件包。您需要在将运行Zabbix前端的系统中启用可选rpm的存储库:
[root@localhost ~]# yum-config-manager --enable rhel-7-server-optional-rpms
### --- 使用如下命令安装zabbix-agent
[root@localhost ~]# yum -y install zabbix-agent
### --- 启动zabbix-agent -y
[root@localhost ~]# systemctl start zabbix-agent.service
[root@localhost ~]# systemctl enable zabbix-agent.service
~~~ 日志文件地址:
[root@localhost ~]# cat /var/log/zabbix/zabbix_agentd.log
二、效验所安装的是否正常:
### --- 通过如下命令进行效验:
~~~ zabbix-server 监听端口为tcp 10051
~~~ zabbix-agent 监听端口为tcp 10050
[root@localhost ~]# ss -tunlp
三、以root身份运行代理
### --- 要覆盖此行为,请创建文件:
[root@localhost ~]# vim /etc/systemd/system/zabbix-agent.service.d/orride.conf
[Service]
User=root
Group=root
### --- 重新加载守护程序并重启zabbix-agent服务:
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart zabbix-agent
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
分类:
cdv003-zabbix
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」