[root@server ~]# vim /etc/zabbix/zabbix_agentd.conf
服务端只需要设置名称
···
Hostname=server
···
[root@server ~]# vim /etc/hosts
192.168.87.129 server (服务端)
192.168.87.128 agernt (需要添加的客户端)
[root@server ~]# systemctl restart zabbix-agent.service
[root@server ~]# systemctl enable zabbix-agent.service
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
二、监控远程linux服务器
1.将server的hosts文件复制到agent上
[root@agent ~]# scp root@192.168.87.129:/etc/hosts /etc/hosts
The authenticity of host '192.168.87.129 (192.168.87.129)' can't be established.
ECDSA key fingerprint is SHA256:GSJLlJgtoagBXmMbWp2t+aTDa0qy8ti+yZX3/Ujycto.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.87.129' (ECDSA) to the list of known hosts.
root@192.168.87.129's password:
hosts 100% 202 293.7KB/s 00:00
[root@agent ~]# ll /etc/ | grep hosts
-rw-r--r--. 1 root root 202 Sep 2 22:20 hosts
关掉客户端和服务端的防火墙,服务端已关
[root@agent ~]# systemctl stop firewalld
[root@agent ~]# systemctl disable firewalld
[root@agent ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled (需要改成disabled)
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted