第七篇、【Zabbix自动注册与Zabbix自动发现】

一、Zabbix自动注册

1、配置Zabbix agent端

#Zabbix agent端的配置
[root@YZS_3WYY_WEB ~]# vi /usr/local/zabbix-4.4.3/etc/zabbix_agentd.conf
      5 
      6 ### Option: PidFile
      7 #       Name of PID file.
      8 #
      9 # Mandatory: no
     10 # Default:
     11 PidFile=/usr/local/zabbix-4.4.3/log/zabbix_agentd.pid
     12 
     13 ### Option: LogType
     14 #       Specifies where log messages are written to:
     15 #               system  - syslog
     16 #               file    - file specified with LogFile parameter
     17 #               console - standard output
     18 #
     19 # Mandatory: no
     20 # Default:
     21 # LogType=file
     22 
     23 ### Option: LogFile
     24 #       Log file name for LogType 'file' parameter.
     25 #
     26 # Mandatory: yes, if LogType is set to file, otherwise no
     27 # Default:
     28 # LogFile=
     29 
     30 LogFile=/usr/local/zabbix-4.4.3/log/zabbix_agentd.log
...
     82 ### Option: Server
     83 #       List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
     84 #       Incoming connections will be accepted only from the hosts listed here.
     85 #       If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally
     86 #       and '::/0' will allow any IPv4 or IPv6 address.
     87 #       '0.0.0.0/0' can be used to allow any IPv4 address.
     88 #       Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
     89 #
     90 # Mandatory: yes, if StartAgents is not explicitly set to 0
     91 # Default:
     92 # Server=
     93 
     94 Server=127.0.0.1,192.168.10.96 #这里填写Zabbix服务端的IP地址
...
    121 ##### Active checks related
    122 
    123 ### Option: ServerActive
    124 #       List of comma delimited IP:port (or DNS name:port) pairs of Zabbix servers and Zabbix proxies for active checks.
    125 #       If port is not specified, default port is used.
    126 #       IPv6 addresses must be enclosed in square brackets if port for that host is specified.
    127 #       If port is not specified, square brackets for IPv6 addresses are optional.
    128 #       If this parameter is not specified, active checks are disabled.
    129 #       Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
    130 #
    131 # Mandatory: no
    132 # Default:
    133 # ServerActive=
    134 
    135 ServerActive=127.0.0.1,192.168.10.96:10051 #填写Zabbix服务端的IP地址与端口
...
    137 ### Option: Hostname
    138 #       Unique, case sensitive hostname.
    139 #       Required for active checks and must match hostname as configured on the server.
    140 #       Value is acquired from HostnameItem if undefined.
    141 #
    142 # Mandatory: no
    143 # Default:
    144 # Hostname=
    145 
    146 Hostname=192.168.10.100
...
    270 ### Option: User
    271 #       Drop privileges to a specific, existing user on the system.
    272 #       Only has effect if run as 'root' and AllowRoot is disabled.
    273 #
    274 # Mandatory: no
    275 # Default:
    276 User=zabbix
...
    278 ### Option: Include
    279 #       You may include individual files or all files in a directory in the configuration file.
    280 #       Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time.
    281 #
    282 # Mandatory: no
    283 # Default:
    284 # Include=
    285 
    286 # Include=/usr/local/etc/zabbix_agentd.userparams.conf
    287 # Include=/usr/local/etc/zabbix_agentd.conf.d/
    288 Include=/usr/local/zabbix-4.4.3/etc/zabbix_agentd.conf.d/*.conf

2、Zabbix Server端配置自动注册的动作

2.1、配置发现到动作后,进行的操作

下面的操作:

(1)、添加到主机群组: 自定义模板主机组
(2)、链接到模板: my template

3、开启Zabbix Agent端

[root@YZS_3WYY_WEB ~]# /etc/init.d/zabbix_agentd start

4、Zabbix Server界面查看主机是否多一台

 

5、自动注册配置成功

二、Zabbix自动发现

1、Zabbix Agent配置跟上面自动注册的一样

2、Zabbix Server创建自动发现规则

 

3、创建自动发现的动作

 

 

4、配置动作的操作

 

5、查看自动发现的结果

 

 

下一篇【Zabbix监控项之网卡流量监控】请点击查看

posted @ 2019-12-30 14:41  小粉优化大师  阅读(448)  评论(0编辑  收藏  举报