1:ubuntu安装agent
1)导入源:
### Ubuntu 20.04
# wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/ubuntu/pool/main/z/zabbix/zabbix-agent2_6.0.7-1+ubuntu20.04_amd64.deb
# dpkg -i zabbix-agent2_6.0.7-1+ubuntu20.04_amd64.deb
### Ubuntu 18.04
# wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu18.04_all.deb
# dpkg -i zabbix-release_6.0-1+ubuntu18.04_all.deb
# apt-get update
---### Ubuntu 16.04
# wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/ubuntu/pool/main/z/zabbix/zabbix-agent_6.0.7-1+ubuntu16.04_amd64.deb
# dpkg -i zabbix-agent_6.0.7-1+ubuntu16.04_amd64.deb
---### Ubuntu 14.04
# wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/ubuntu/pool/main/z/zabbix/zabbix-agent_6.0.7-1+ubuntu14.04_amd64.deb
# dpkg -i zabbix-agent_6.0.7-1+ubuntu14.04_amd64.deb
2)安装:
dpkg -i ******
apt-get install zabbix-agent2
3)配置:
vim /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.1.1 ##zabbix服务器地址
ServerActive=192.168.1.1 ##zabbix服务器地址
Hostname=本机IP
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1
EnableRemoteCommands=0
4)启动:
/etc/init.d/zabbix-agent start 或者 service zabbix-agent start
5)验证:
启动完成后注意查看10050端口有没有开启
netstat -tlnp
2:centos安装agent
1)下载源
wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/rhel/7/x86_64/zabbix-agent2-6.0.7-1.el7.x86_64.rpm
rpm -ivh zabbix-agent2-6.0.7-1.el7.x86_64.rpm
2)yum安装zabbix-agent
centos8安装agent:
wget https://mirrors.aliyun.com/zabbix/zabbix/6.0/rhel/8/x86_64/zabbix-agent2-6.0.7-1.el8.x86_64.rpm
rpm -ivh zabbix-agent2-6.0.7-1.el8.x86_64.rpm
3)配置
mv /etc/zabbix/zabbix_agent2.conf /etc/zabbix/zabbix_agent2.conf.bak
vim /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.1.1 ##zabbix服务器地址
ServerActive=192.168.1.1 ##zabbix服务地址
Hostname=本机IP
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1
EnableRemoteCommands=0
4)启动
systemctl restart zabbix-agent
systemctl enable zabbix-agent
5)验证:
启动完成后注意查看10050端口有没有开启
netstat -tlnp
3:windows安装agent
1)官网下载zabbix-agent的软件包
下载4.4.10版本的即可
https://www.zabbix.com/cn/download_agents
2)安装agent
双击下好的安装包根据提示下一步即可
- Host Name 建议填写客户端的IP地址
- Zabbix server IP/DNS 填写服务端的IP地址,只写proxy的IP地址即可
- Server or proxy for active checks 填写服务端的IP地址,只写proxy的IP地址即可
4:安装失败可以尝试编译安装agent
1)下载源码包
wget --no-check-certificate https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.0.16/zabbix-4.0.16.tar.gz
解压
tar -xvzf zabbix-4.0.16.tar.gz -C /usr/local
2)安装依赖
yum install -y gcc gcc-c++ make pcre-devel
3)配置zabbix用户
groupadd zabbix
useradd -g zabbix -M -s /sbin/nologin zabbix
4)安装agent
cd /use/local/zabbix-4.0.16
./configure --prefix=/usr/local/zabbix-4.0.16 --enable-agent
make && make install