can't start sensu ubuntu client

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:"/etc/sensu/config.json"}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:"/etc/sensu/config.json"}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:"/etc/sensu/conf.d"}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

That client.json is not valid json. It is missing tailing commas and has invalid characters and stuff.

···

On Tue, Jul 12, 2016 at 2:48 PM, Константин Мокеев 243714km@gmail.com wrote:

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

Thanks for you answer

but

// its comment

and , be present

I’m write new config

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [“ALL”],

}

}

The result is the same

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T12:07:31.585850+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586011+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586073+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T12:07:31.586133+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T12:07:31.586180+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

···

среда, 13 июля 2016 г., 7:32:15 UTC+3 пользователь Kyle Anderson написал:

That client.json is not valid json. It is missing tailing commas and has invalid characters and stuff.

On Tue, Jul 12, 2016 at 2:48 PM, Константин Мокеев 2437...@gmail.com wrote:

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

Long term I recommend using a configuration management tool to write out configs. JSON is for machines.

Short term I recommend the jq command to help validate the files are at least valid JSON:

https://stedolan.github.io/jq/

···

On Wed, Jul 13, 2016 at 2:36 AM, Константин Мокеев 243714km@gmail.com wrote:

Thanks for you answer

but

// its comment

and , be present

I’m write new config

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [“ALL”],

}

}

The result is the same

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T12:07:31.585850+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586011+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586073+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T12:07:31.586133+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T12:07:31.586180+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

среда, 13 июля 2016 г., 7:32:15 UTC+3 пользователь Kyle Anderson написал:

That client.json is not valid json. It is missing tailing commas and has invalid characters and stuff.

On Tue, Jul 12, 2016 at 2:48 PM, Константин Мокеев 2437...@gmail.com wrote:

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

-bash-4.2# cat /etc/sensu/conf.d/client.json | python -m json.tool

{

“client”: {

“address”: “10.10.99.23”,

“name”: “sensuTEst.example.com”,

“subscriptions”: [

“os”,

“webservers”

]

}

}

···

среда, 13 июля 2016 г., 18:06:14 UTC+3 пользователь Kyle Anderson написал:

Long term I recommend using a configuration management tool to write out configs. JSON is for machines.

Short term I recommend the jq command to help validate the files are at least valid JSON:

https://stedolan.github.io/jq/

On Wed, Jul 13, 2016 at 2:36 AM, Константин Мокеев 2437...@gmail.com wrote:

Thanks for you answer

but

// its comment

and , be present

I’m write new config

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [“ALL”],

}

}

The result is the same

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T12:07:31.585850+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586011+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586073+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T12:07:31.586133+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T12:07:31.586180+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

среда, 13 июля 2016 г., 7:32:15 UTC+3 пользователь Kyle Anderson написал:

That client.json is not valid json. It is missing tailing commas and has invalid characters and stuff.

On Tue, Jul 12, 2016 at 2:48 PM, Константин Мокеев 2437...@gmail.com wrote:

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

Hmm. Looks good to me.
Can you verify there are not other “client” sections in any config file?

Maybe use the --print-config option and see what sensu thinks the config is?

https://sensuapp.org/docs/latest/reference/configuration.html#sensu-command-line-interfaces-and-arguments

···

On Fri, Jul 15, 2016 at 1:52 AM, Константин Мокеев 243714km@gmail.com wrote:

-bash-4.2# cat /etc/sensu/conf.d/client.json | python -m json.tool

{

“client”: {

“address”: “10.10.99.23”,

“name”: “sensuTEst.example.com”,

“subscriptions”: [

“os”,

“webservers”

]

}

}

среда, 13 июля 2016 г., 18:06:14 UTC+3 пользователь Kyle Anderson написал:

Long term I recommend using a configuration management tool to write out configs. JSON is for machines.

Short term I recommend the jq command to help validate the files are at least valid JSON:

https://stedolan.github.io/jq/

On Wed, Jul 13, 2016 at 2:36 AM, Константин Мокеев 2437...@gmail.com wrote:

Thanks for you answer

but

// its comment

and , be present

I’m write new config

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [“ALL”],

}

}

The result is the same

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T12:07:31.585850+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586011+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T12:07:31.586073+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T12:07:31.586133+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T12:07:31.586180+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}

среда, 13 июля 2016 г., 7:32:15 UTC+3 пользователь Kyle Anderson написал:

That client.json is not valid json. It is missing tailing commas and has invalid characters and stuff.

On Tue, Jul 12, 2016 at 2:48 PM, Константин Мокеев 2437...@gmail.com wrote:

sudo /etc/init.d/sensu-client start

Starting sensu-client [FAILED]

**ls -lh /etc/sensu/conf.d/client.json **

-rw-rw-rw- 1 sensu sensu 421 Jul 13 00:42 /etc/sensu/conf.d/client.json

cat /etc/sensu/conf.d/client.json

{

“client”: {

“name”: “sensu.server”,

“address”: “10.10.10.100”,

“subscriptions”: [ “ALL” ]

“socket”: {

“bind”: “0.0.0.0”,

“port”: 3031

}

}

//

“rabbitmq”: {

“vhost”: “/sensu”,

“host”: “localhost”,

“password”: “password”,

“port”: 5672,

“user”: “sensu”

}

}

tail -f /var/log/sensu/sensu-client.log

{“timestamp”:“2016-07-13T00:42:44.119558+0300”,“level”:“warn”,“message”:“config file does not exist or is not readable”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.119889+0300”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2016-07-13T00:42:44.120066+0300”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2016-07-13T00:42:44.120217+0300”,“level”:“fatal”,“message”:“client must be a hash”,“object”:null}

{“timestamp”:“2016-07-13T00:42:44.120335+0300”,“level”:“fatal”,“message”:“SENSU NOT RUNNING!”}