Hi Icinga Community,
I’m extending an existing monitoring enviroment with some Windows Servers 2019.
For security reasons one of them is not allowed to connect from the agent to the master.
So using the Icinga Wizard is not possible as it can’t fetch a certificate from the master.
I’ve found a similar article from 2yrs ago but it doesn’t work for me the same way:
##############################
- OS master: Debian GNU/Linux, platform version 10
- Version master: The Icinga 2 network monitoring daemon (version: r2.12.3-1)
- OS agent: Windows Servers 2019
- Version agent: Icinga2-v2.12.4
- Enabled features on agent: api mainlog notification
- Disabled features on agent: checker debuglog elasticsearch gelf graphite influxdb opentsdb perfdata
I run only one master with several agents connected. Using the Icinga Wizard works absolutely fine for all other agents. But not using the Wizard fails.
The agent was integrated in the monitoring and performs successfully a ping check. But the master can’t fetch any remote check results from the agent
Icinga2-Service is running on the agent
But a telnet from the master to the agent on port 5665 fails, connection refused.
Using netstat -a
on the agent shows, that the port 5665 is not active (not listed)
##############################
What I’ve done:
- I’ve installed Icinga on the Windows Server, then created and signed the certificate on the master with the following two commands:
cinga2 pki new-cert --cn server.foo.bar --key server.foo.bar.key --csr server.foo.bar.csr
icinga2 pki sign-csr --csr server.foo.bar.csr --cert server.foo.bar.crt
- Then copied the certificate and the key into
/var/lib/icinga2/certs
on the agent node - Then copied the ca.crt from
/var/lib/icinga2/ca
(on the master) in the same folder on the agent - Enabled the api-feature with
C:\Program Files\ICINGA2\sbin> .\icinga2.exe feature enable api
Checking the log-files on icinga master and agent, I don’t get much information.
Log entry from master:
[2021-07-09 12:57:04 +0200] information/ApiListener: Reconnecting to endpoint 'ms2019p-epdhcp.domain.com' via host 'ms2019p-epdhcp.domain.com' and port '5665'
[2021-07-09 12:57:04 +0200] critical/ApiListener: Cannot connect to host 'ms2019p-epdhcp.domain.com' on port '5665': Connection refused
[2021-07-09 12:57:14 +0200] information/ApiListener: Reconnecting to endpoint 'ms2019p-epdhcp.domain.com' via host 'ms2019p-epdhcp.domain.com' and port '5665'
[2021-07-09 12:57:14 +0200] critical/ApiListener: Cannot connect to host 'ms2019p-epdhcp.domain.com' on port '5665': Connection refused
[2021-07-09 12:57:24 +0200] information/ApiListener: Reconnecting to endpoint 'ms2019p-epdhcp.domain.com' via host 'ms2019p-epdhcp.domain.com' and port '5665'
[2021-07-09 12:57:24 +0200] critical/ApiListener: Cannot connect to host 'ms2019p-epdhcp.domain.com' on port '5665': Connection refused
[2021-07-09 12:57:34 +0200] information/ApiListener: Reconnecting to endpoint 'ms2019p-epdhcp.domain.com' via host 'ms2019p-epdhcp.domain.com' and port '5665'
[2021-07-09 12:57:34 +0200] critical/ApiListener: Cannot connect to host 'ms2019p-epdhcp.domain.com' on port '5665': Connection refused
[2021-07-09 12:57:44 +0200] information/ApiListener: Reconnecting to endpoint 'ms2019p-epdhcp.domain.com' via host 'ms2019p-epdhcp.domain.com' and port '5665'
[2021-07-09 12:57:44 +0200] critical/ApiListener: Cannot connect to host 'ms2019p-epdhcp.domain.com' on port '5665': Connection refused
Log entry from agent: (comes daily)
[2021-07-08 02:00:03 +0200] information/Checkable: Checkable 'MS2019P-EPDHCP!load' has 1 notification(s). Checking filters for type 'DowntimeStart', sends will be logged.
[2021-07-08 02:00:03 +0200] information/Notification: Sending 'DowntimeStart' notification 'MS2019P-EPDHCP!load!mail-icingaadmin' for user 'icingaadmin'
[2021-07-08 02:00:03 +0200] information/Downtime: Triggering downtime 'MS2019P-EPDHCP!load!6b853396-81b9-4c95-b64c-d5d1576a3996' for checkable 'MS2019P-EPDHCP!load'.
[2021-07-08 02:00:03 +0200] warning/PluginUtility: Error: Non-optional macro 'service.output' used in argument '-o' is missing.
[2021-07-08 02:00:03 +0200] warning/PluginNotificationTask: Notification command for object 'MS2019P-EPDHCP!load' (PID: 4294967295, arguments: '') terminated with exit code 3, output: Error: Non-optional macro 'service.output' used in argument '-o' is missing.
[2021-07-08 02:00:03 +0200] information/Notification: Completed sending 'DowntimeStart' notification 'MS2019P-EPDHCP!load!mail-icingaadmin' for checkable 'MS2019P-EPDHCP!load' and user 'icingaadmin' using command 'mail-service-notification'.
[2021-07-08 02:00:23 +0200] information/ConfigObjectUtility: Created and activated object 'MS2019P-EPDHCP!load!551240ba-0bad-4460-933e-4f72440fae0f' of type 'Downtime'.
[2021-07-08 02:00:23 +0200] information/Downtime: Added downtime 'MS2019P-EPDHCP!load!551240ba-0bad-4460-933e-4f72440fae0f' between '2021-07-09 02:00:00' and '2021-07-09 03:00:00', author: 'icingaadmin', fixed
[2021-07-08 02:04:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:09:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:14:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:19:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:24:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:29:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:34:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:39:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:44:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:49:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:54:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 02:59:18 +0200] information/ConfigObject: Dumping program state to file 'C:\ProgramData\icinga2\var\lib\icinga2/icinga2.state'
[2021-07-08 03:00:24 +0200] information/Checkable: Checkable 'MS2019P-EPDHCP!load' has 1 notification(s). Checking filters for type 'DowntimeEnd', sends will be logged.
[2021-07-08 03:00:24 +0200] information/Notification: Sending 'DowntimeEnd' notification 'MS2019P-EPDHCP!load!mail-icingaadmin' for user 'icingaadmin'
[2021-07-08 03:00:24 +0200] warning/PluginUtility: Error: Non-optional macro 'service.output' used in argument '-o' is missing.
[2021-07-08 03:00:24 +0200] information/ConfigObjectUtility: Deleted object 'MS2019P-EPDHCP!load!6b853396-81b9-4c95-b64c-d5d1576a3996' of type 'Downtime'.
[2021-07-08 03:00:24 +0200] warning/PluginNotificationTask: Notification command for object 'MS2019P-EPDHCP!load' (PID: 4294967295, arguments: '') terminated with exit code 3, output: Error: Non-optional macro 'service.output' used in argument '-o' is missing.
[2021-07-08 03:00:24 +0200] information/Downtime: Removed downtime 'MS2019P-EPDHCP!load!6b853396-81b9-4c95-b64c-d5d1576a3996' from checkable 'MS2019P-EPDHCP!load' (Reason: expired at 2021-07-08 03:00:00 +0200).
[2021-07-08 03:00:24 +0200] information/Notification: Completed sending 'DowntimeEnd' notification 'MS2019P-EPDHCP!load!mail-icingaadmin' for checkable 'MS2019P-EPDHCP!load' and user 'icingaadmin' using command 'mail-service-notification'.
I’m fairly new to Icinga and don’t understand all the magic behind it entirely. It seems to me, that the Icinga service is running but not listening to the port 5665?
It would be very appreciated if someone can push me in the right direction.
Thank you very much and kind regards
Kevin