GithubHelp home page GithubHelp logo

Comments (15)

sstarcher avatar sstarcher commented on June 16, 2024

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"

from docker-sensu.

sstarcher avatar sstarcher commented on June 16, 2024

Looking at the docs the template requires

CLIENT_NAME *no default*
CLIENT_ADDRESS *no default*

from docker-sensu.

Northwood128 avatar Northwood128 commented on June 16, 2024

I did override it. Check the volumes section under the client definition in the docker-compose.yml file. Is this what you mean? Thanks!

  • "./client-conf/client.json:/etc/sensu/config.json"

from docker-sensu.

sstarcher avatar sstarcher commented on June 16, 2024

Close, but not correct.
You overwrote /etc/sensu/config.json not /etc/sensu/conf.d/client.json

from docker-sensu.

Northwood128 avatar Northwood128 commented on June 16, 2024

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?

from docker-sensu.

sstarcher avatar sstarcher commented on June 16, 2024

Looks like it blindly processes the templates.

  • You can either try and set the 2 values it wants and let sensu merge your configuration file in addition to the default config.
  • You can replaced the original template with your file and it should copy it to the correctly location.

from docker-sensu.

sstarcher avatar sstarcher commented on June 16, 2024

https://github.com/sstarcher/docker-sensu/blob/master/Dockerfile#L32

from docker-sensu.

Northwood128 avatar Northwood128 commented on June 16, 2024

I'm gonna try to create a new client definition using only environment variables and I'll let you know how it goes.

from docker-sensu.

sstarcher avatar sstarcher commented on June 16, 2024

If you set the 2 required variables it should merge your file with the templated file.

from docker-sensu.

Northwood128 avatar Northwood128 commented on June 16, 2024

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.

from docker-sensu.

amirhmi avatar amirhmi commented on June 16, 2024

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?

from docker-sensu.

arecalde-edrans avatar arecalde-edrans commented on June 16, 2024

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'

from docker-sensu.

amirhmi avatar amirhmi commented on June 16, 2024

Can I run that with docker run and only change env variables?

@arecalde-edrans

from docker-sensu.

arecalde-edrans avatar arecalde-edrans commented on June 16, 2024

Yeah. With -e

from docker-sensu.

amirhmi avatar amirhmi commented on June 16, 2024

thank you very much
@arecalde-edrans

from docker-sensu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.