Closed Northwood128 closed 7 years ago
The template for the client.json is located here - https://github.com/sstarcher/docker-sensu/blob/master/templates/client.json.tmpl
I would recommend running the container and changing the entrypoint to /bin/sh so you can run the start command yourself and capture the client.json to verify that it's valid.
If you don't intend to use the template that this container provides I would recommend overwriting it with your file ./client-conf/client.json:/etc/sensu/config.json"
Looking at the docs the template requires
CLIENT_NAME *no default*
CLIENT_ADDRESS *no default*
I did override it. Check the volumes section under the client definition in the docker-compose.yml file. Is this what you mean? Thanks!
Close, but not correct.
You overwrote /etc/sensu/config.json
not /etc/sensu/conf.d/client.json
Ok ,I did that and I still get the same error. Not only that, the file I mounted on /etc/sensu/conf.d/client.json gets changed by this:
{
"client": {
"socket": {
"bind": "127.0.0.1"
},
"name": "51f83f494049",
"address": ,
"deregister": true,
"subscriptions": [
"all"
,"default"
],
"keepalive": {
"thresholds": {
"warning": 120,
"critical": 180
},
"handler": "default"
}
}
}
{"timestamp":"2017-06-25T14:48:49.358825+0000","level":"fatal","message":"config file must be valid json","file":"/etc/sensu/conf.d/client.json","error":"unexpected comma at line 7, column 17 [parse.c:575]"}
It looks like its not letting me use my own config file and instead it wants me to set all those env variables. Was it supposed to be like that?
Looks like it blindly processes the templates.
I'm gonna try to create a new client definition using only environment variables and I'll let you know how it goes.
If you set the 2 required variables it should merge your file with the templated file.
Confirmed. You have to set up those variables in the docker-compose.yml file. You can't just use a configuration file. Thanks! It works now.
I have the same problem and error .
But I don't get what you did for this purpose.
Can you tell me how you made that work?
Hi @amirhmi ! If you read above, you can see that what I did was set up those environment variables on my docker-compose.yml
CLIENT_NAME: 'something'
CLIENT_ADDRESS: '127.0.0.1'
Can I run that with docker run and only change env variables?
@arecalde-edrans
Yeah. With -e
thank you very much @arecalde-edrans
Howdy!!
I'm trying to create a Sensu Stack in order to have a quick way to instantiate a development stage for Sensu related tools. I found your image very convenient. However I'm having some issues starting the sensu client container.
This is my docker-compose.yml
All of the containers start just fine but the one for the client. Is shows this message:
./client-conf/client.json looks like:
I don't know where it gets that /etc/sensu/conf.d/* config files. Can you lend me a hand? Thanks in advance!