0

我正在尝试将 Zabbix 代理自动注册到 Zabbix 服务器 UI,但似乎我遗漏了一些东西,但是当我尝试通过 UI(手动)进行注册时,它正在工作。有人可以帮我做吗。

我的配置 -

/etc/zabbix/zabbix_agentd.conf

Server=127.0.0.1,{zabbix-server-ip}
ServerActive=DNS Name
HostMetadata=ubuntu (string why which i am doing configuration in UI)

对此,我们将不胜感激。

4

3 回答 3

1

编写了一个脚本,用于将 Zabbix 代理自动注册到 Zabbix 服务器。

对于自动发现,您需要在 Zabbix UI/frontend 中使用Configuration → Actions下的HostMetadata设置规则。关注这个

然后您可以继续在代理上执行脚本

#Note - This script takes zabbixserverip metadatastring as input at runtime sh script.sh internal-dns-name free-string
#!/bin/bash
zabbixserverip=$1
metadatastring=$2
apt update -y
apt install zabbix-agent
sed -i -- 's/Server=127.0.0.1/Server='$zabbixserverip'/g' /etc/zabbix/zabbix_agentd.conf
echo "ServerActive=$zabbixserverip" >> /etc/zabbix/zabbix_agentd.conf
echo "HostMetadata=$metadatastring" >> /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent
systemctl status zabbix-agent
于 2021-03-17T09:20:33.690 回答
0

你配置错ServerServerActive:都需要设置为Zabbix Proxy/Server的IP/DNS,没有本地IP/DNS。

于 2021-03-03T15:45:03.013 回答
0

首先,您需要设置zabbix服务器的IP或DNS的ServerServerActive

对于自动发现,您需要在 zabbix UI/frontend 中使用Configuration → Actions下的HostMetadata设置规则。

检查链接是否对您有帮助。

https://www.zabbix.com/documentation/4.2/manual/discovery/auto_registration

于 2021-03-04T05:52:18.560 回答