zabbix agent added to the interface of the web being monitored side (+ auto discovery manually add automatic registration +)

1. Add the monitoring host

(1) add a host manually monitoring
Objective: To manually add a host server2

首先先在server2上进行设置:

(1) 配置yum仓库,下载zabbix-agent,并修改代理配置文件
[root@server1 yum.repos.d]# ls
redhat.repo  westos.repo  zabbix.repo
[root@server1 yum.repos.d]# scp zabbix.repo [email protected]:/etc/yum.repos.d
The authenticity of host '172.25.33.2 (172.25.33.2)' can't be established.
ECDSA key fingerprint is 75:95:da:07:65:8f:01:97:87:e0:3f:cc:bc:85:44:a6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.25.33.2' (ECDSA) to the list of known hosts.
[email protected]'s password: 
zabbix.repo                                             100%   61     0.1KB/s   00:00 
[root@server2 yum.repos.d]# yum install zabbix-agent -y      ##下载代理端
[root@server2 yum.repos.d]# cd /etc/zabbix/
[root@server2 zabbix]# ls
zabbix_agentd.conf  zabbix_agentd.d
[root@server2 zabbix]# vim zabbix_agentd.conf      ##修改代理的监控配置文件

98 Server=172.25.33.1   #被动发现服务器ip


139 ServerActive=172.25.33.1  #主动发现服务器ip

150 Hostname=server2    #主机名,因为已经做过解析

[root@server2 zabbix]# systemctl start zabbix-agent
[root@server2 zabbix]# systemctl enable zabbix-agent
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
[root@server2 zabbix]# netstat -antlp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      835/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      885/master          
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      10680/zabbix_agentd 
tcp        0      0 172.25.4.2:22           172.25.4.250:39000      ESTABLISHED 1205/sshd: root@pts 
tcp6       0      0 :::22                   :::*                    LISTEN      835/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      885/master          
tcp6       0      0 :::10050                :::*                    LISTEN      10680/zabbix_agentd 

Here Insert Picture DescriptionHere Insert Picture Description
Here Insert Picture Description

其次:
在监控页面中选择配置-->主机-->创建主机
主机名称:server2
群组:linux servers
Ip地址:172.25.33.2  
然后点击模板,选择template 0s linux
最后点击添加
可以在主机中看到server2已经添加成功

Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture Description
There will be some disadvantages when you add manually, when a large number of agents end, you manually add more difficult, we can use auto-discovery and auto-enrollment

(2) automatically discovers monitoring host (have the same characteristics as the host for large quantities)

Objective: To automatically discover and add server2

<1> the first step has been added to the host server2 delete, click on the event source configuration: automatic discovery, and then select the action you must first enable action to create an automated discovery rules
Here Insert Picture Description
<2> Click the auto-discovery, auto-discovery rules create the name: local Network
ip range: 172.25.4.1-254
contents of the client checks to zabbix "system.uname"
and then click enabled
and then click monitoring in the top click automatic discovery has been found that the device will find server2

Here Insert Picture DescriptionHere Insert Picture Description
(3) automatic registration
Objective: automatic registration discovery server3
open server3, process monitoring and manual discovery foregoing process as the host server2

<1> in the presence of the monitoring interface to monitor action to delete, select automatically registered in action
Add new action name: auto_reg (arbitrarily)
select the host name contains server3
also add operating in action (adding a host add host group linux servers linked to the template template os linux), click enable
Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture Description<2> and then configure the host can be found add server3 add in the
Here Insert Picture Description

Published 250 original articles · won praise 2 · views 10000 +

Guess you like

Origin blog.csdn.net/yrx420909/article/details/104930406