我在 Centos 6.5 机器上设置了 sensu,并在 sensu 机器上安装/配置了客户端,所以它像这样监控自己
/etc/sensu/conf.d/client.json
{
"client": {
"name": "sensu",
"address": "10.100.1.200",
"subscriptions": [
"ALL"
]
}
}
这工作正常,它显示在 Uchiwa 中,但现在我有另一个主机我想在 Sensu/Uchiwa 注册,它没有出现在 Uchiwa/Sensu 下的客户端中
这是客户端“咖啡”上的配置
/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
。对比
解决方案
通过使用以下方式同步时钟解决了该问题
timedatectl
:并通过发出以下命令更改时区:
将服务器上的时间与客户端同步:
重启后
sensu-services
发现rabbitmq
客户端sensu-api
在Uchiwa中注册。