# Sensu Windows client not seeing config.yml

**URL:** <https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056>\
**Category:** Sensu Go\
**Created:** [September 23, 2020, 8:27pm UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056 "2020-09-23T20:27:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvinzi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/mvinzi/32/468_2.png) [@mvinzi](https://discourse.sensu.io/u/mvinzi)\
**Post date:** [September 23, 2020, 8:27pm UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056/1 "2020-09-23T20:27:33Z")

</div>

I cannot get Windows to find my backend server. The windows client refuses to use the agent.yml configuration file. I have my configuration file in c:\programdata\sensu\config\agent.yml as documentation suggests.

I then use sensu-agent service install.  
When the service starts i look in the log file configured at c:\programdata\sensu\log\agent.log and it is trying to connect to 127.0.0.1.

This is a vm running on Windows Server 2019. This was built from source code at [https://github.com/sensu/sensu-go](https://github.com/sensu/sensu-go)

Versions are:

sensu-agent version (devel)+ce, community edition, built with go1.15.2  
sensu-backend version (devel)+ce, community edition, built with go1.14.6

They both used the same v. 6.0.0 tagged source code.

My configuration is:

```
---

```

# Sensu agent configuration

## 

# agent overview

## 

name: “GITCIDEVWIN03”  
#namespace: “default”  
#subscriptions:

# - example

#labels:

# example\_key: “example value”

#annotations:

# example/key: “example value”

## 

# agent configuration

## 

backend-url:

- “wss://sensutest-backend1:8081”  
#disable-assets: false  
log-level: “debug” # available log levels: panic, fatal, error, warn, info, debug

## 

# api configuration

## 

#api-host: “127.0.0.1”  
#api-port: 3031  
#disable-api: false  
#events-burst-limit: 10  
#events-rate-limit: 10.0

## 

# authentication configuration

## 

#user: “agent”  
#password: “P@ssw0rd!”

## 

# monitoring configuration

## 

#deregister: false  
#deregistration-handler: “example\_handler”  
keepalive-warning-timeout: 300  
#keepalive-interval: 20

## 

# security configuration

## 

#insecure-skip-tls-verify: false  
#redact:

# - password

# - passwd

# - pass

# - api\_key

# - api\_token

# - access\_key

# - secret\_key

# - private\_key

# - secret

trusted-ca-file: “c:\opt\sensu-go\ssl\ca.pem”

## 

# socket configuration

## 

#disable-sockets: false  
#socket-host: “127.0.0.1”  
#socket-port: 3030

## 

# statsd configuration

## 

#statsd-disable: false  
#statsd-event-handlers:

# - example\_handler

#statsd-flush-interval: 10  
#statsd-metrics-host: “127.0.0.1”  
#statsd-metrics-port: 8125

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [September 23, 2020, 9:33pm UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056/2 "2020-09-23T21:33:40Z")

</div>

> [@mvinzi](#):
>
> c:\programdata\sensu\config\

Hey,  
Did you make the change to the configuration file after starting the Sensu Agent service? You might need to stop and restart the service to ensure your changes are picked up. The configuration file is only read once at beginning of service start.

---

<div class="post-metadata">

**Author:** ![mvinzi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/mvinzi/32/468_2.png) [@mvinzi](https://discourse.sensu.io/u/mvinzi)\
**Post date:** [September 24, 2020, 12:34am UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056/3 "2020-09-24T00:34:12Z")

</div>

I have recreated the service multiple times. Stopped and started it. Is there something that needs to be deleted after the service restarts or anything?

---

<div class="post-metadata">

**Author:** ![mvinzi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/mvinzi/32/468_2.png) [@mvinzi](https://discourse.sensu.io/u/mvinzi)\
**Post date:** [September 24, 2020, 11:56am UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056/4 "2020-09-24T11:56:35Z")

</div>

The log states:

> **LogFile**
>
> {“component”:“agent”,“level”:“info”,“msg”:“API shutting down”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“component”:“agent”,“event”:{“Title”:“Gostatsd stopped”,“Text”:“Gostatsd stopped”,“DateHappened”:1600948504,“Hostname”:“gitcidevwin03”,“AggregationKey”:"",“SourceTypeName”:"",“Tags”:null,“SourceIP”:"",“Priority”:1,“AlertType”:0},“level”:“info”,“msg”:“statsd received an event”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“level”:“warning”,“msg”:“Error reading from socket: read udp 127.0.0.1:8125: use of closed network connection”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“level”:“warning”,“msg”:“Error reading from socket: read udp 127.0.0.1:8125: use of closed network connection”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“level”:“warning”,“msg”:“Error closing socket: close udp 127.0.0.1:8125: use of closed network connection”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“level”:“warning”,“msg”:“Error reading from socket: read udp 127.0.0.1:8125: use of closed network connection”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“level”:“warning”,“msg”:“Error reading from socket: read udp 127.0.0.1:8125: use of closed network connection”,“time”:“2020-09-24T07:55:04-04:00”}  
> {“component”:“cmd”,“level”:“info”,“logger-config”:{“Path”:“C:\ProgramData\sensu\log\sensu-agent.log”,“MaxSizeBytes”:134217728,“RetentionDuration”:604800000000000,“RetentionFiles”:10},“msg”:“logging to file”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“cmd”,“level”:“info”,“msg”:“sensu-agent service starting”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“compacting api queue”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“finished api queue compaction”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“using password auth”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“configuration successfully validated”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“starting statsd server on address: 127.0.0.1:8125”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“starting UDP listener on address: 127.0.0.1:3030”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“starting TCP listener on address: 127.0.0.1:3030”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“event”:{“Title”:“Gostatsd started”,“Text”:“Gostatsd started”,“DateHappened”:1600948506,“Hostname”:“gitcidevwin03”,“AggregationKey”:"",“SourceTypeName”:"",“Tags”:null,“SourceIP”:"",“Priority”:1,“AlertType”:0},“level”:“info”,“msg”:“statsd received an event”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:"connecting to backend URL “ws://127.0.0.1:8081"”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:“starting api on address: 127.0.0.1:3031”,“time”:“2020-09-24T07:55:06-04:00”}  
> {“component”:“agent”,“error”:“dial tcp 127.0.0.1:8081: connectex: No connection could be made because the target machine actively refused it.”,“level”:“error”,“msg”:“reconnection attempt failed”,“time”:“2020-09-24T07:55:07-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:"connecting to backend URL “ws://127.0.0.1:8081"”,“time”:“2020-09-24T07:55:07-04:00”}  
> {“component”:“agent”,“error”:“dial tcp 127.0.0.1:8081: connectex: No connection could be made because the target machine actively refused it.”,“level”:“error”,“msg”:“reconnection attempt failed”,“time”:“2020-09-24T07:55:08-04:00”}  
> {“component”:“agent”,“level”:“info”,“msg”:"connecting to backend URL “ws://127.0.0.1:8081"”,“time”:“2020-09-24T07:55:08-04:00”}  
> {“component”:“agent”,“error”:“dial tcp 127.0.0.1:8081: connectex: No connection could be made because the target machine actively refused it.”,“level”:“error”,“msg”:“reconnection attempt failed”,“time”:“2020-09-24T07:55:09-04:00”}

---

<div class="post-metadata">

**Author:** ![mvinzi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/mvinzi/32/468_2.png) [@mvinzi](https://discourse.sensu.io/u/mvinzi)\
**Post date:** [September 24, 2020, 1:50pm UTC](https://discourse.sensu.io/t/sensu-windows-client-not-seeing-config-yml/2056/5 "2020-09-24T13:50:29Z")

</div>

I found out what was wrong. There should be something that says why the config file isnt valid. It turned out to be this line:

trusted-ca-file: “c:\opt\sensu-go\ssl\ca.pem”

It should be escaped…

trusted-ca-file: “c:\opt\sensu-go\ssl\ca.pem”
