我在Centos 6.5盒子上安装了sensu,并在sensu盒子上安装/configuration了客户端,所以它像这样监控自己
/etc/sensu/conf.d/client.json
{ "client": { "name": "sensu", "address": "10.100.1.200", "subscriptions": [ "ALL" ] } }
这工作正常,它出现在Uchiwa,但现在我有另一个主机,我想注册与Sensu / Uchiwa,它不显示在Uchiwa / Sensu下的客户
这里的客户端configuration“咖啡”
/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" ] } }
当我在咖啡上查看/var/log/sensu/sensu-client.log时,看到以下内容:
{"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"}
它看起来像是在和RabbitMQ交谈,但由于某种原因客户端并没有出现在Uchiwa。 我怎样才能进一步深入,弄清楚发生了什么事情,让咖啡服务器注册?
这个问题是由于sensu-client和sensu-server之间的显着时间差异造成的。
user@sensu-server:~# date Mon Aug 15 06:17:37 UTC 2016
与
user@sensu-client:~$ date ma aug 15 08:17:37 CEST 2016
解
问题是通过使用timedatectl同步时钟来解决的:
user@sensu-server:~# sudo timedatectl list-timezones Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers ...
并通过发出以下内容更改时区:
user@sensu-server:~# sudo timedatectl set-timezone Europe/Amsterdam
将服务器上的时间与客户端同步:
user@sensu-server:~# date Mon Aug 15 08:25:14 UTC 2016
在重新启动了sensu-services和rabbitmq ,在sensu-apifind了客户端并在rabbitmq注册了。