3

I have setup sensu on a Centos 6.5 box and installed/configured the client on the sensu box so it monitors itself like so

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

{
  "client": {
    "name": "sensu",
    "address": "10.100.1.200",
    "subscriptions": [
      "ALL"
    ]
  }
}

This works fine and it shows up in Uchiwa, but now I have another host I want to register with Sensu/Uchiwa and it does not show up in clients under Uchiwa/Sensu

Here's the configuration on the client "coffee"

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

{
 "rabbitmq":{
  "host": "10.100.1.200",
  "port": "5672",
  "vhost": "/sensu",
  "user": "user",
  "pass": "pass"
 }
}

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

{
  "client": {
    "name": "coffee",
    "address": "10.100.1.19",
    "subscriptions": [
      "ALL"
    ]
  }
}

When I tail the /var/log/sensu/sensu-client.log on coffee I see the following:

{"timestamp":"2015-07-13T07:15:52.856009-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/client.json"}
{"timestamp":"2015-07-13T07:15:52.856157-0500","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/client.json","changes":{"client":{"subscriptions":[["ALL","ALL"],["ALL"]]}}}
{"timestamp":"2015-07-13T07:15:52.856235-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/rabbitmq.json"}
{"timestamp":"2015-07-13T07:15:52.856330-0500","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/rabbitmq.json","changes":{"rabbitmq":{"port":[5672,"5672"],"pass":"REDACTED"}}}
{"timestamp":"2015-07-13T07:15:52.859696-0500","level":"warn","message":"loading extension files from directory","directory":"/etc/sensu/extensions"}
{"timestamp":"2015-07-13T07:15:53.051176-0500","level":"warn","message":"reconnecting to transport"}

It looks like it's talking to RabbitMQ but for some reason the client does not appear in Uchiwa. How can I dive into this further and figure out what's going on and get the coffee server to register?

030
  • 5,731
  • 12
  • 61
  • 107
nulltek
  • 1,171
  • 3
  • 13
  • 22
  • So I was getting a Plain login refused error in the rabbitmq logs. I changed the password to something like pAssW0Rd (not my actual password fyi) and rabbitmq allowed the sensu client to connect. But now it's still not showing in my Uchiwa dashboard. – nulltek Jul 13 '15 at 17:28
  • Here's the log showing the connection =INFO REPORT==== 13-Jul-2015::12:22:22 === accepting AMQP connection <0.435.0> (10.100.1.19:43998 -> 10.100.1.200:5672) – nulltek Jul 13 '15 at 17:29
  • 1
    You should try to verify the logs for sensu-server (`/var/log/sensu/sensu-server.log`) and sensu-api (`/var/log/sensu/sensu-api.log`). Since the Uchiwa dashboard uses the sensu-api to retrieve information about your clients, you could start by making sure they appear in the API. –  Jul 14 '15 at 14:02
  • They do show up in the sensu-api.log actually. – nulltek Jul 14 '15 at 18:59

1 Answers1

4

The issue was caused by a significant time difference between the sensu-client and sensu-server.

user@sensu-server:~# date
Mon Aug 15 06:17:37 UTC 2016

vs.

user@sensu-client:~$ date
ma aug 15 08:17:37 CEST 2016

Solution

The issue was solved by synchronizing the clocks using timedatectl:

user@sensu-server:~# sudo timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
...

and changing the timezone by issuing:

user@sensu-server:~# sudo timedatectl set-timezone Europe/Amsterdam

synchronized the time on the server with the client:

user@sensu-server:~# date
Mon Aug 15 08:25:14 UTC 2016

After restarting the sensu-services and rabbitmq the client was found in the sensu-api and registered in Uchiwa.

030
  • 5,731
  • 12
  • 61
  • 107
  • 1
    I'm shocked this is a thing, but thanks for your answer. Spent hours on this. `UTC` for everything I guess... – Mike Shultz Jul 20 '17 at 02:41