0

I installed icinga2 and icingaweb2 on master node I installed icinga2 on 3 more servers as agent nodes. I used icinga2 node wizard, configured them as agent and allowed them to connect to master node. i don't see any error messages and it looks like they where connected successfully.

is there anything else needs to be done in order for them to be visible in the master node?

the icingaweb2 interface only shows me the master node, none of the rest is showing.

I configured the agents as specified here: https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/#agentsatellite-setup

I have port 5665 opened from the master to the agents and from the agents to the master.

after signing the certificates in the master I would receive the following in the master log for all nodes

information/ApiListener: New client connection for identity 'NODE_NAME' from [145.239.141.102]:47518 (no Endpoint object found for identity)

I assumed that I don't need to manually add configuration in the parent node.. but since I got this error i added the following for each agent node:

object Zone "<HOST-NAME>" {
        endpoints = ["<HOST-NAME>"]
    parent = "master"
}

object Endpoint "<HOST-NAME>" {
        host = "<HOST-NAME>"
}

so I added this for all 3 servers with agents and now I don't see any errors but they still don't appear in the icingaweb2 interface.

this is the icinga2 log when I restart icinga2 on master:

[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);

any information regarding this issue would be greatly appreciated.

ufk
  • 323
  • 3
  • 7
  • 26
  • Do you see the nodes if you run `sudo icinga2 node list` on the master? – Leo Apr 26 '20 at 19:53
  • @Leo - I use iThe Icinga 2 network monitoring daemon (version: r2.11.3-1). it doesn't have that command, I google and found out it was deprecated but i couldn't find a different command to see the nodes. when I executed node wizard on the other nodes they where able to properly connect to their master and I accepted their certificates – ufk Apr 28 '20 at 04:28

1 Answers1

0

the issue is finally resolved.

that's what I did to come up with the solution:

I have two gentoo servers at home. I installed icinga as master on one, and as node on another, I didn't need to add any configuration in the master node for the slave node to be detected, and it was detect automatically.

I noticed that on gentoo i have icinga 2.11.3 installed while on ubuntu it was 2.10.

Today i updated the packages, it updated to 2.11.x but it did not resolve the issue.

so I went to my gentoo master icinga2 server and check its configuration and I noticed that's what I needed to add in my configuration of the master node to detect each host:

object Host "<ENDPOINT_NAME>" {
        address = "<HOST_IP_OR_DNS>"
        check_command = "hostalive"
        vars.os = "Linux"
}

object Endpoint "<ENDPOINT_NAME>" {
}

object Zone "<ENDPOINT_NAME>" {
 endpoints = ["<ENDPOINT_NAME>"]
parent = "master"
}

so in the new version and configuration I didn't need to manually sign and accept the certificate on the master.

I have no idea why on gentoo I didn't need to manually add this configuration.. if i would investigate the configuration more i would have probably figured out but I don't mind for now adding this manually on the master node for each host.

so that's it... the hosts are properly detected.

thanks everyone!

ufk
  • 323
  • 3
  • 7
  • 26