Sensu remote client cannot receive check request

hi guys,

Today when I trying to set up a sensu remote client, I met a problem, my remote sensu client can connect to rabbitmq, but cannot receive check request that published by sensu server.

My sensu version is 0.29.0

My rabbitMQ version is 3.6.9

I setup Sensu Server, api, client and rabbitMQ, redis on VM1, all of them works fine, sensu client can execute check correctly.

but when I setup a remote sensu client on VM2, I got a problem, which is that my remote sensu client on VM2 can connect to rabbitMQ(installed on VM1) and authenticated correctly, but cannot receive check request which published by sensu server. I cannot see the remote client on uchiwa too anyone could help?

My rabbitMQ config on VM1 is as bellow:

cat /etc/rabbitmq/rabbitmq.config

[

{rabbit, [

]}

].

my rabbitmq.json on VM1 is:

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

{

“host”: “127.0.0.1”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “secret”,

“heartbeat”: 30,

“prefetch”: 50

}

my rabbitmq.json on VM2 is:

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

{

“rabbitmq”: {

"host": "xxxxx(VM1 IP)",

"port": 5672,

"vhost": "/sensu",

"user": "sensu",

"password": "secret"

}

}

after I start the remote client on VM2 I see the follow logs:

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

{“timestamp”:“2017-05-03T11:10:57.217909-0400”,“level”:“warn”,“message”:“ignoring config file”,“file”:"/etc/sensu/config.json"}

{“timestamp”:“2017-05-03T11:10:57.217946-0400”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:"/etc/sensu/conf.d"}

{“timestamp”:“2017-05-03T11:10:57.217986-0400”,“level”:“warn”,“message”:“loading config file”,“file”:"/etc/sensu/conf.d/transport.json"}

{“timestamp”:“2017-05-03T11:10:57.218019-0400”,“level”:“warn”,“message”:“loading config file”,“file”:"/etc/sensu/conf.d/rabbitmq.json"}

{“timestamp”:“2017-05-03T11:10:57.218063-0400”,“level”:“warn”,“message”:“config file applied changes”,“file”:"/etc/sensu/conf.d/rabbitmq.json",“changes”:{“rabbitmq”:[null,{“host”:“xx.xx.xx.xx(VM1 IP)”,“port”:5672,“vhost”:"/sensu",“user”:“sensu”,“password”:“REDACTED”}]}}

{“timestamp”:“2017-05-03T11:10:57.218102-0400”,“level”:“warn”,“message”:“loading config file”,“file”:"/etc/sensu/conf.d/client.json"}

{“timestamp”:“2017-05-03T11:10:57.218146-0400”,“level”:“warn”,“message”:“config file applied changes”,“file”:"/etc/sensu/conf.d/client.json",“changes”:{“client”:{“name”:[“jasondisensu”,“client-1”],“address”:[“xx.xx.xx.xx(VM2 IP)”,“127.0.0.1”],“subscriptions”:[null,[“check-from-sensu-master”,“client:client-1”]]}}}

{“timestamp”:“2017-05-03T11:10:57.218186-0400”,“level”:“warn”,“message”:“applied sensu client overrides”,“client”:{“name”:“client-1”,“address”:“127.0.0.1”,“subscriptions”:[“check-from-sensu-master”,“client:client-1”]}}

{“timestamp”:“2017-05-03T11:10:57.221463-0400”,“level”:“warn”,“message”:“loading extension files from directory”,“directory”:"/etc/sensu/extensions"}

{“timestamp”:“2017-05-03T11:10:57.221529-0400”,“level”:“info”,“message”:“configuring sensu spawn”,“settings”:{“limit”:12}}

and it’s stoped there after output the above log, there is no other logs anymore, and cannot receive check request too, this remote sensu client cannot show in uchiwa too.

but I can find the log on rabbitMQ for this remote client as bellow:

=INFO REPORT==== 3-May-2017::11:10:57 ===

connection <0.1053.0> ((VM2 IP):50333 -> (VM1 IP):5672): user ‘sensu’ authenticated and granted access to vhost ‘/sensu’

so strange, anyone could help?

thanks

Jason

Sounds like you have a check which is published from the server for subscription named “check-from-sensu-master” but not running on the client. Can you also share the check definitions (JSON)?

thank you guys, at least I found I made a mistake with rabbitmq.json, I used different rabbitmq user and vhost, so sensu client cannot receive the published message for check, thanks for your reply

···

On Wednesday, May 3, 2017 at 11:18:23 PM UTC+8, jason.D wrote:

hi guys,

Today when I trying to set up a sensu remote client, I met a problem, my remote sensu client can connect to rabbitmq, but cannot receive check request that published by sensu server.

My sensu version is 0.29.0

My rabbitMQ version is 3.6.9

I setup Sensu Server, api, client and rabbitMQ, redis on VM1, all of them works fine, sensu client can execute check correctly.

but when I setup a remote sensu client on VM2, I got a problem, which is that my remote sensu client on VM2 can connect to rabbitMQ(installed on VM1) and authenticated correctly, but cannot receive check request which published by sensu server. I cannot see the remote client on uchiwa too anyone could help?

My rabbitMQ config on VM1 is as bellow:

cat /etc/rabbitmq/rabbitmq.config

[

{rabbit, [

]}

].

my rabbitmq.json on VM1 is:

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

{

“host”: “127.0.0.1”,

“port”: 5672,

“vhost”: “/sensu”,

“user”: “sensu”,

“password”: “secret”,

“heartbeat”: 30,

“prefetch”: 50

}

my rabbitmq.json on VM2 is:

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

{

“rabbitmq”: {

"host": "xxxxx(VM1 IP)",
"port": 5672,
"vhost": "/sensu",
"user": "sensu",
"password": "secret"

}

}

after I start the remote client on VM2 I see the follow logs:

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

{“timestamp”:“2017-05-03T11:10:57.217909-0400”,“level”:“warn”,“message”:“ignoring config file”,“file”:“/etc/sensu/config.json”}

{“timestamp”:“2017-05-03T11:10:57.217946-0400”,“level”:“warn”,“message”:“loading config files from directory”,“directory”:“/etc/sensu/conf.d”}

{“timestamp”:“2017-05-03T11:10:57.217986-0400”,“level”:“warn”,“message”:“loading config file”,“file”:“/etc/sensu/conf.d/transport.json”}

{“timestamp”:“2017-05-03T11:10:57.218019-0400”,“level”:“warn”,“message”:“loading config file”,“file”:“/etc/sensu/conf.d/rabbitmq.json”}

{“timestamp”:“2017-05-03T11:10:57.218063-0400”,“level”:“warn”,“message”:“config file applied changes”,“file”:“/etc/sensu/conf.d/rabbitmq.json”,“changes”:{“rabbitmq”:[null,{“host”:“xx.xx.xx.xx(VM1 IP)”,“port”:5672,“vhost”:“/sensu”,“user”:“sensu”,“password”:“REDACTED”}]}}

{“timestamp”:“2017-05-03T11:10:57.218102-0400”,“level”:“warn”,“message”:“loading config file”,“file”:“/etc/sensu/conf.d/client.json”}

{“timestamp”:“2017-05-03T11:10:57.218146-0400”,“level”:“warn”,“message”:“config file applied changes”,“file”:“/etc/sensu/conf.d/client.json”,“changes”:{“client”:{“name”:[“jasondisensu”,“client-1”],“address”:[“xx.xx.xx.xx(VM2 IP)”,“127.0.0.1”],“subscriptions”:[null,[“check-from-sensu-master”,“client:client-1”]]}}}

{“timestamp”:“2017-05-03T11:10:57.218186-0400”,“level”:“warn”,“message”:“applied sensu client overrides”,“client”:{“name”:“client-1”,“address”:“127.0.0.1”,“subscriptions”:[“check-from-sensu-master”,“client:client-1”]}}

{“timestamp”:“2017-05-03T11:10:57.221463-0400”,“level”:“warn”,“message”:“loading extension files from directory”,“directory”:“/etc/sensu/extensions”}

{“timestamp”:“2017-05-03T11:10:57.221529-0400”,“level”:“info”,“message”:“configuring sensu spawn”,“settings”:{“limit”:12}}

and it’s stoped there after output the above log, there is no other logs anymore, and cannot receive check request too, this remote sensu client cannot show in uchiwa too.

but I can find the log on rabbitMQ for this remote client as bellow:

=INFO REPORT==== 3-May-2017::11:10:57 ===

connection <0.1053.0> ((VM2 IP):50333 → (VM1 IP):5672): user ‘sensu’ authenticated and granted access to vhost ‘/sensu’

so strange, anyone could help?

thanks

Jason