从这里开始,您可以开始自界说Zabbix安装并添加新主机。 您的第一步应该是变动当前暗码。 要执行此操纵,请单击顶部导航上的设置文件图标导航到用户设置文件页面。
将新主机添加到Zabbix处事器
将用于监督的新主机添加到Zabbix处事器的进程包罗两个步调。
首先,您需要在长途主机上安装Zabbix署理,然后通过Web界面将主机添加到Zabbix处事器。
安装Zabbix署理
本教程假设主机也利用Ubuntu 18.04。
与安装Zabbix处事器时沟通,运行以下呼吁以启用Zabbix存储库:
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
sudo apt install ./zabbix-release_4.0-2+bionic_all.deb
更新措施包索引并安装Zabbix署理措施包:
sudo apt update
sudo apt install zabbix-agent
Zabbix支持两种要领用于处事器 - 客户端通信加密,预共享密钥(PSK)和基于证书的加密。 在本教程中,我们将利用预共享密钥(PSK)要领来掩护处事器和署理之间的毗连。
利用以下呼吁生成预共享密钥并将其生存到文件中:
[linuxidc@linux:~/www.linuxidc.com]$ openssl rand -hex 32 | sudo tee /etc/zabbix/zabbix_agentd.psk
[sudo] linuxidc 的暗码:
PSK键看起来像这样:
d29afe7076f78793aef43dfc6459a9c148050afca95968a77eaad2d1c0349b2e
打开Zabbix署理设置文件:
[linuxidc@linux:~/www.linuxidc.com]$ sudo vim /etc/zabbix/zabbix_agentd.conf
搜索处事器IP地点并将其从默认值变动为Zabbix处事器IP:
/etc/zabbix/zabbix_agentd.conf
...
### Option: Server
# List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally
# and '::/0' will allow any IPv4 or IPv6 address.
# '0.0.0.0/0' can be used to allow any IPv4 address.
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
#
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=
Server=127.0.0.1
...
接下来,找到TSLConnect选项,打消注释并将其配置为psk:
/etc/zabbix/zabbix_agentd.conf
...
### Option: TLSConnect
# How the agent should connect to server or proxy. Used for active checks.
# Only one value can be specified:
# unencrypted - connect without encryption
# psk - connect using TLS and a pre-shared key
# cert - connect using TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
TLSConnect=psk
...
找到TLSAccept选项,打消注释并将其配置为psk:
/etc/zabbix/zabbix_agentd.conf