我的屏幕上有 Uchiwa,但它闪烁着我提到的错误。
跟踪 sensu-api 日志没有发现太多信息:
{"timestamp":"2014-10-15T04:02:44.553226-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/client.json"}
{"timestamp":"2014-10-15T04:02:44.553292-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/redis.json"}
{"timestamp":"2014-10-15T04:02:44.553386-0500","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/redis.json","changes":{"redis":[null,{"host":"localhost","port":6379}]}}
{"timestamp":"2014-10-15T04:02:44.553472-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/rabbitmq.json"}
{"timestamp":"2014-10-15T04:02:44.553582-0500","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/rabbitmq.json","changes":{"rabbitmq":[null,{"ssl":{"cert_chain_file":"/etc/sensu/ssl/cert.pem","private_key_file":"/etc/sensu/ssl/key.pem"},"host":"localhost","port":5671,"vhost":"/sensu","user":"sensu","password":"REDACTED"}]}}
{"timestamp":"2014-10-15T04:02:44.553662-0500","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/api.json"}
{"timestamp":"2014-10-15T04:02:44.553755-0500","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/api.json","changes":{"api":[null,{"host":"localhost","port":4567,"user":"sensu","password":"REDACTED"}]}}
{"timestamp":"2014-10-15T04:02:52.336757-0500","level":"info","message":"GET /info","remote_address":"127.0.0.1","user_agent":null,"request_method":"GET","request_uri":"/info","request_body":""}
至少对我来说不是。
API 配置是:
[root@ws00 sensu]# cat conf.d/api.json
{
"api": {
"host": "localhost",
"port": 4567,
"user": "sensu",
"password": "REDACTED"
}
}
接下来是他们在 github 上讨论的健康检查的输出(https://github.com/sensu/uchiwa/blob/master/README.md):
/健康
{"uchiwa":"ok","sensu":{"Sensu":{}}}
/健康/感觉
{"sensu":{"Sensu":{}}}
/健康/uchiwa
{"uchiwa":"ok"}
关键点?
service sensu-api status
报告称,一切运行顺利,无需担心。
无论如何,谷歌不会返回任何“Sensu API Sensu 错误”的信息,所以我希望大家能够帮忙!
如果查看其他配置会很方便,请告诉我。
答案1
另一种可能是您的 uchiwa.json 文件的位置。
我遇到过类似的问题,不知道发生了什么,但当我在 /etc/sensu/conf.d 中创建 uchiwa.json 文件时,似乎出现了问题,但同时默认配置在 /etc/sensu 中创建了一个 uchiwa.json 文件。出于某种原因,uchiwa 希望文件位于 /etc/sensu 中,现在我对该配置很满意,因为它终于让 api 正常工作了。祝你好运。