我在主节点上安装了 icinga2 和 icingaweb2 我在另外 3 个服务器上安装了 icinga2 作为代理节点。我使用icinga2 node wizard
,将它们配置为代理并允许它们连接到主节点。我没有看到任何错误消息,看起来它们已成功连接。
为了让它们在主节点中可见,还需要做些什么吗?
icingaweb2 界面只显示了主节点,其余的都没有显示。
我按照此处的说明配置了代理:https ://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/#agentsatellite-setup
我打开了从主机到代理以及从代理到主机的端口 5665。
在 master 中签署证书后,我将在所有节点的 master 日志中收到以下内容
information/ApiListener: New client connection for identity 'NODE_NAME' from [145.239.141.102]:47518 (no Endpoint object found for identity)
我假设我不需要在父节点中手动添加配置.. 但由于我收到此错误,我为每个代理节点添加了以下内容:
object Zone "<HOST-NAME>" {
endpoints = ["<HOST-NAME>"]
parent = "master"
}
object Endpoint "<HOST-NAME>" {
host = "<HOST-NAME>"
}
所以我为所有 3 台带有代理的服务器添加了这个,现在我没有看到任何错误,但它们仍然没有出现在 icingaweb2 界面中。
这是我在 master 上重新启动 icinga2 时的 icinga2 日志:
[2020-04-22 08:12:39 +0000] information/FileLogger: 'main-log' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: 'api' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: Started new listener on '[0.0.0.0]:5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-03' via host 'AGENT-HOST-03' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-02' via host 'AGENT-HOST-02' and port '5665'
[2020-04-22 08:12:39 +0000] information/DbConnection: 'ido-pgsql' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-01' via host 'AGENT-HOST-01' and port '5665'
[2020-04-22 08:12:39 +0000] information/NotificationComponent: 'notification' started.
[2020-04-22 08:12:39 +0000] information/CheckerComponent: 'checker' started.
[2020-04-22 08:12:39 +0000] information/ConfigItem: Activated all objects.
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: 'ido-pgsql' resumed.
[2020-04-22 08:12:39 +0000] information/DbConnection: Resuming IDO connection: ido-pgsql
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: PGSQL IDO instance id: 1 (schema version: '1.14.3')
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-02' to [51.178.76.91]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-01' to [51.178.91.176]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-01' via host 'AGENT-HOST-01' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-02' via host 'AGENT-HOST-02' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-03' to [145.239.141.102]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-03' via host 'AGENT-HOST-03' and port '5665'
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: Finished reconnecting to 'ido-pgsql' database 'icinga2' in 0.0555351 second(s).
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-01' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-01' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-02' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-02' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-03' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-03' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:49 +0000] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0.233333/s (14/min 14/5min 14/15min);
[2020-04-22 08:12:49 +0000] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate: 0/s (0/min 0/5min 0/15min);
[2020-04-22 08:12:49 +0000] information/WorkQueue: #7 (IdoPgsqlConnection, ido-pgsql) items: 0, rate: 0.25/s (15/min 15/5min 15/15min);
任何有关此问题的信息将不胜感激。
问题终于解决了。
这就是我提出解决方案的方法:
我家有两台gentoo服务器。我在一个上安装了icinga作为master,另一个作为node,我不需要在master节点中添加任何配置来检测slave节点,它是自动检测的。
我注意到在gentoo上我安装了icinga 2.11.3,而在ubuntu上它是2.10。
今天我更新了软件包,它更新到 2.11.x 但它没有解决问题。
所以我去了我的 gentoo 主 icinga2 服务器并检查了它的配置,我注意到这是我需要在我的主节点配置中添加的内容以检测每个主机:
所以在新版本和配置中我不需要手动签署和接受master上的证书。
我不知道为什么在 gentoo 上我不需要手动添加这个配置.. 如果我要调查更多配置我可能会想出来但我现在不介意在每个主机的主节点上手动添加这个.
就是这样......主机被正确检测到。
感谢大家!