在官网下载二进制包:这里直接使用wget
wget https://cdn.zabbix.com/zabbix/binaries/stable/4.0/4.0.30/zabbix_agent-4.0.30-linux-3.0-amd64-static.tar.gz
之后进行解压
[root@zabbix_client ~]# tar xvf zabbix_agent-4.0.30-linux-3.0-amd64-static.tar.gz
./
./bin/
./bin/zabbix_sender
./bin/zabbix_get
./conf/
./conf/zabbix_agentd/
./conf/zabbix_agentd/userparameter_examples.conf
./conf/zabbix_agentd/userparameter_mysql.conf
./conf/zabbix_agentd.conf
./sbin/
./sbin/zabbix_agentd
[root@zabbix_client ~]# ls 可以看到有3个文件夹
anaconda-ks.cfg bin conf sbin
[root@zabbix_client conf]# vim zabbix_agentd.conf 进到conf文件夹内编辑此文件
修改server 和 hostname
本机地址(被监控端)
服务器端地址
[root@zabbix_client sbin]# ./zabbix_agentd 启动agent服务报错
zabbix_agentd [1830]: cannot open config file "/usr/local/etc/zabbix_agentd.conf": [2] No such file or directory
[root@zabbix_client sbin]# cp ../conf/zabbix_agentd.conf /usr/local/etc/ 复制配置文件
[root@zabbix_client sbin]# ./zabbix_agentd
zabbix_agentd [1832]: user zabbix does not exist
[root@zabbix_client sbin]# groupadd zabbix
[root@zabbix_client sbin]# useradd zabbix -s /sbin/nologin -g zabbix
[root@zabbix_client sbin]# ./zabbix_agentd
[root@zabbix_client sbin]# ps -ef |grep zabbix_agentd
zabbix 1848 1 0 09:56 ? 00:00:00 ./zabbix_agentd
zabbix 1849 1848 0 09:56 ? 00:00:00 ./zabbix_agentd: collector [idle 1 sec]
zabbix 1850 1848 0 09:56 ? 00:00:00 ./zabbix_agentd: listener #1 [waiting for connection]
zabbix 1851 1848 0 09:56 ? 00:00:00 ./zabbix_agentd: listener #2 [waiting for connection]
zabbix 1852 1848 0 09:56 ? 00:00:00 ./zabbix_agentd: listener #3 [waiting for connection]
zabbix 1853 1848 0 09:56 ? 00:00:00 ./zabbix_agentd: active checks #1 [idle 1 sec]
root 1855 1596 0 09:56 pts/0 00:00:00 grep --color=auto zabbix_agentd