安装

Download and install Zabbix 6.0 LTS for CentOS 7

此方法使用官方的yum安装,在此链接找到系统对应的方法
centos7 zabbix6.0lts agent2

#!/bin/bash

HOSTIP=改成你的zabbix服务器ip
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-4.el7.noarch.rpm
yum clean all
yum -y install zabbix-agent2 zabbix-agent2-plugin-*

sed -i '80s#Server=127.0.0.1#Server='"${HOSTIP}"'#' /etc/zabbix/zabbix_agent2.conf
sed -i '133s#ServerActive=127.0.0.1#ServerActive='"${HOSTIP}"'#' /etc/zabbix/zabbix_agent2.conf
sed -i '144s#Hostname=Zabbix server#Hostname='"${HOSTNAME}"'#' /etc/zabbix/zabbix_agent2.conf
systemctl restart zabbix-agent2
systemctl enable zabbix-agent2

一定要确保防火墙放行了端口10050非常重要!

注意如果是zabbix服务器自身需要监控,HOSTIP要手动改成容器的IP地址!

文件列表

[root@terminal_01 ~]# rpm -ql zabbix-agent
/etc/logrotate.d/zabbix-agent
/etc/zabbix/zabbix_agentd.conf
/etc/zabbix/zabbix_agentd.d
/usr/lib/systemd/system/zabbix-agent.service
/usr/lib/tmpfiles.d/zabbix-agent.conf
/usr/sbin/zabbix_agentd
/usr/share/doc/zabbix-agent-6.0.12
/usr/share/doc/zabbix-agent-6.0.12/AUTHORS
/usr/share/doc/zabbix-agent-6.0.12/COPYING
/usr/share/doc/zabbix-agent-6.0.12/ChangeLog
/usr/share/doc/zabbix-agent-6.0.12/NEWS
/usr/share/doc/zabbix-agent-6.0.12/README
/usr/share/doc/zabbix-agent-6.0.12/userparameter_mysql.conf
/usr/share/man/man8/zabbix_agentd.8.gz
/var/log/zabbix
/var/run/zabbix