[英]How to configure Sensu with RMQ and InfluxDB
I am trying to get started with a monitoring server solution. 我正在尝试使用监视服务器解决方案。 I got the Sensu Clients, RabbitMQ and Uchiwa configured but then I tried using Graphite but there were so many parts to configure I tried InfluxDB instead.
我配置了Sensu Clients,RabbitMQ和Uchiwa,但是后来我尝试使用Graphite,但是要配置的部分太多了,我尝试了InfluxDB。 I am stuck configuring Sensu to InfluxDB.
我坚持将Sensu配置为InfluxDB。 Is there a part missing in the below configuration?
以下配置中缺少一部分吗?
Client [Sensu] > RabbitMQ <> Sensu Server <> InfluxDB <> Grafana
Any suggestions? 有什么建议么?
cat influx.json
{
"influxdb": {
"hosts" : ["192.168.1.1"],
"host" : "192.168.1.1",
"port" : "8086",
"database" : "sensumetrics",
"time_precision": "s",
"use_ssl" : false,
"verify_ssl" : false,
"initial_delay" : 0.01,
"max_delay" : 30,
"open_timeout" : 5,
"read_timeout" : 300,
"retry" : null,
"prefix" : "",
"denormalize" : true,
"status" : true
}
}
cat handler.json
{
"handlers": {
"influxdb": {
"type": "pipe",
"command": "/opt/sensu/embedded/bin/metrics-influxdb.rb"
}}}
checks1, 检查1,
{
"checks": {
"check_memory_linux": {
"handlers": ["influxdb","default"],
"command": "/opt/sensu/embedded/bin/check-memory-percent.rb -w 90 -c 95",
"interval": 60,
"occurrences": 5,
"subscribers": [ "TEST" ]
}}}
checks2, 检查2,
{
"checks": {
"check_cpu_linux-elkctrl-pipe": {
"type": "metric",
"command": "/opt/sensu/embedded/bin/check-cpu.rb -w 80 -c 90",
"subscribers": ["TEST"],
"interval": 10,
"handlers": ["debug","influxdb"]
}}}
To use InfluxDB to persist your data, you must have: 要使用InfluxDB保留数据,您必须具有:
Your checks must send results to the handler, so their definition must contain: 您的检查必须将结果发送到处理程序,因此其定义必须包含:
"handlers": [
"influxdb"
]
Or whatever name you gave your handler. 或您给处理人员提供的任何名称。
Case, if the influxdb config you provided above is the full extent of your configuration, it would seem to be missing the username/password attributes required by the influxdb configuration. 情况是,如果上面提供的influxdb配置完全是您的配置范围,则似乎缺少了influxdb配置所需的用户名/密码属性。 If they're present, but not provided in the post, no big deal.
如果存在但未在帖子中提供,则没什么大不了的。 However, I'd recommend doing the following for your Sensu logs:
但是,我建议对您的Sensu日志执行以下操作:
grep -i influxdb /var/logs/sensu/sensu-server.log
And seeing if the check result is getting sent to your influxdb instance. 并查看检查结果是否已发送到您的influxdb实例。 If they are, you should be receiving an error that might be pointing a bit more to what's going on.
如果是这样,您应该会收到一条错误消息,该错误消息可能会更多地指示正在发生的事情。
You can also check your influxdb logs to see if they're getting a post from your Sensu server: 您还可以检查您的influxdb日志,以查看它们是否正在从您的Sensu服务器上获取帖子:
journalctl -u influxdb.service -f
But yeah, if the username/password is missing from the configuration, that'd be the first place that I start. 但是,是的,如果配置中缺少用户名/密码,那将是我开始的第一个地方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.