NO.B.0004——zabbix_lamp+zabbix.agent.yum源安装_V.20102

1. Install zabbix-agent:

1、添加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
2、使用如下命令安装zabbix-agent
[root@localhost ~]# yum -y install zabbix-agent
3、启动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 

Check whether what we have installed is normal:

通过如下命令进行效验:
[root@localhost ~]# ss -tunlp
    zabbix-server 监听端口为tcp 10051
    zabbix-agent  监听端口为tcp 10050

Run the agent as root

//要覆盖此行为,请创建文件:
[root@localhost ~]# vim /etc/systemd/system/zabbix-agent.service.d/orride.conf
[Service]
User=root
Group=root
5、重新加载守护程序并重启zabbix-agent服务:
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart  zabbix-agent

Guess you like

Origin blog.51cto.com/15005403/2552372