# Windows Agent not Connecting

**URL:** <https://community.icinga.com/t/windows-agent-not-connecting/3679>\
**Category:** Icinga Director\
**Tags:** windows-agent\
**Created:** [March 3, 2020, 2:35pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679 "2020-03-03T14:35:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 2:35pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/1 "2020-03-03T14:35:59Z")

</div>

I’ve been using Icinga2 with little to no issues for a long while now. We have the agent automatically deploying and everything has been working perfectly for quite some time.

Today, I have a Windows server that was previously working with the agent all of the sudden reporting it has no connection with icinga2.

 ![image](https://community.icinga.com/uploads/default/original/2X/c/cf17c8708fedb99fa2ee291117626e952b431577.png)

I tried my usual fixes that always have worked in the past. For example uninstalling it and letting it reinstall. This didn’t resolve the issue. I also disabled the firewall on both the Windows server and the Icinga2 server for troubleshooting purposes. This did not help either.

I see no errors or warnings in the deployments through director and I can’t think of anything that has changed recently except for cutting over the Icinga2web to https (this works fine).

All other Windows agents continue to connect and monitor services as expected.

What could be causing this? Where should I look?

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 3, 2020, 3:17pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/2 "2020-03-03T15:17:36Z")

</div>

In such cases I always start with looking into the logs, especially affected agent and its parent(s). My typical errors are hostname-certificate-missmatch, missing parents host ip, unsigned certificate…

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 3:30pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/3 "2020-03-03T15:30:07Z")

</div>

Thanks, I see nothing in the icinga log file of interest on the Windows host. What is odd to me is that all other Windows hosts are working fine and the agent deployment is controlled/cookie-cutter.

This could be a certificate issue but I’m not really sure where to look. I ran icinga2 ca list on the Icinga2 server and there are none. Also nothing is listed with --all.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 3:34pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/4 "2020-03-03T15:34:57Z")

</div>

I think I see the problem in the server icinga2 log. It is falling to connect to the host on the port with connection refused. I will keep digging.

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 3, 2020, 3:36pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/5 "2020-03-03T15:36:17Z")

</div>

Certificate issues are reported in the logs. If nothing is reported than typically none of the partners tries to connect (typical due to missing “contact” config). [Here](https://icinga.com/docs/icinga2/latest/doc/15-troubleshooting/#cluster-troubleshooting-connection-errors) you’ll find some troubleshooting tips.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 3:39pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/6 "2020-03-03T15:39:07Z")

</div>

Thanks. Right now I think the Windows agent is not listening on 5665… weird… but that is where I’m at now. Trying to understand why.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 7:34pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/7 "2020-03-03T19:34:55Z")

</div>

So it seems like my problem is that the Icinga2 agent on the Windows server will not listen on 5665.

I tried uninstalling it and reinstalling it. The service is running. But no matter what I try I never see it listening on 5665. Other Windows servers that are working show the 5665 port and a connection to the Icinga2 server as expected.

Where should I look for why the icinga service wouldn’t be listening on 5665?

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 3, 2020, 8:03pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/8 "2020-03-03T20:03:45Z")

</div>

I ran the Icinga2 Windows Agent install via the Powershell script that we have installing it manually to watch what happens.

Everything looked clean except for this:

 ![image](https://community.icinga.com/uploads/default/original/2X/7/760153b6c4f5323c33116db81e2eef7eb615d1fb.png)

It seems like there is a problem with getting the conf file and maybe that is why it isn’t listening. Any idea where to look from here? I’m wondering if this has to do with the API and our recent change to SSL/https instead of http

---

<div class="post-metadata">

**Author:** ![log1c](https://community.icinga.com/user_avatar/community.icinga.com/log1c/32/2071_2.png) [@log1c](https://community.icinga.com/u/log1c)\
**Post date:** [March 4, 2020, 7:03am UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/9 "2020-03-04T07:03:39Z")

</div>

As you use the Director: Do you deploy the agent with the Director-given host template token and the code snippet?

As there is an “Error 401 Unauthorized”:  
Did you, maybe, change the API user/password for the director? Or changed the agent key/token for the host template?  
You also write “change to https”: Is your code snippet maybe still with http instead of https?

A tip for reinstalling the agent:

- uninstall the agent
- then delete c:\program data\icinga2  
so the system is completely clean from the previous icinga2 install.

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 4, 2020, 7:16am UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/10 "2020-03-04T07:16:09Z")

</div>

Are you using a self signed certificate which is not stored at the local certificate store of that Windows machine? If so you need to add `-IgnoreSSLErrors` (assuming you use [icinga2-powershell-module](https://github.com/Icinga/icinga2-powershell-module)).

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 4, 2020, 7:45am UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/11 "2020-03-04T07:45:22Z")

</div>

BTW: You should take a look at the new [Icinga for Windows Packages](https://icinga.com/2020/02/19/announcing-icinga-for-windows-v1-0/) which will replace the old icinga2-powershell-module.

---

<div class="post-metadata">

**Author:** ![unic](https://community.icinga.com/user_avatar/community.icinga.com/unic/32/200_2.png) [@unic](https://community.icinga.com/u/unic)\
**Post date:** [March 4, 2020, 8:04am UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/12 "2020-03-04T08:04:54Z")

</div>

HI,

have you tried starting icinga from command line with icinga2.exe daemon to see whats happening?

How is your connection configured? The master/satellite is connecting to the agent ?

In my environments in most cases its the network team which kills my connections or the Virusscanner/appsecurity has got some “hardening” 🙂 In rare cases I \*\*\*\*\*\* up Icinga and do not know that i have done it 😉

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 12:52pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/13 "2020-03-04T12:52:46Z")

</div>

I am using Director and the powershell script. The agent installer is on a share and I configured it all in director. No passwords were changed.

I upgraded Director last night to the latest version just to make sure I was up to date.

Yes, I discovered the programdata thing early on when initially deploying the agent 🙂

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 12:56pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/14 "2020-03-04T12:56:32Z")

</div>

The interesting thing is the I never had this problem before and there have been no changes to anything other than modifying icinga2 to use https instead of http and the addition of the VMware module for vSphere which required a few modules be updated to their latest versions.

If I curl the API url with https from a linux box it detects a self signed certificate (our internal CA) and complains/fails but if I pass -k to ignore the detection it proceeds with no issue. I tried adding the root and intermediate certificates to the linux box I was curling from but it still complained and I had to ignore it to proceed.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 12:57pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/15 "2020-03-04T12:57:54Z")

</div>

I’m going to look at this right now. Anything that would simplify the Windows agent process would be great as of now I am doing the powershell module with Director and deploying via SCCM. It has worked flawlessly since I initially configured it quite some time ago.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 12:58pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/16 "2020-03-04T12:58:52Z")

</div>

In this case it seems that the problem is communicating with the Icinga2 server and getting the config for the Windows agent over the API. I have ruled out firewalls, networking issues etc…

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 1:04pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/17 "2020-03-04T13:04:22Z")

</div>

It seems like this is more of a set of scripts/modules to run powershell checks on an existing agent installation? It is a little confusing.

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 4, 2020, 1:06pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/18 "2020-03-04T13:06:15Z")

</div>

Yes, and it handles the installation of the Windows agents also.

---

<div class="post-metadata">

**Author:** ![csmall](https://community.icinga.com/user_avatar/community.icinga.com/csmall/32/617_2.png) [@csmall](https://community.icinga.com/u/csmall)\
**Post date:** [March 4, 2020, 1:07pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/19 "2020-03-04T13:07:58Z")

</div>

OK. Sounds like an updated version of what I am currently using.

Whatever my issue is seems to be with the agent installation not being able to use the self service api in director any longer.

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [March 4, 2020, 1:09pm UTC](https://community.icinga.com/t/windows-agent-not-connecting/3679/20 "2020-03-04T13:09:36Z")

</div>

Did you try with the parameter `-IgnoreSSLErrors`?

[Next page](https://community.icinga.com/t/windows-agent-not-connecting/3679.md?page=2)
