Hello, I’ve just set up a sensu server. It has a sensu client installed on the same VM as the sensu server, so it is monitoring itself. I installed an uchiwa dashboard and a memory metrics check. Everything seemed to be working fine. The sensu server log was publishing check requests, the client received check requests and seemed to be responding with the proper memory ouput, as the uchiwa dashboard shows the output from the check.
Now, I am trying to install a handler. this handler should take the output from the check and put it into influxDB.
I have another sensu server that has been using this exact configuration and works perfectly. However, when I try to install this handler, it is as if the sensu-server does not ever recognize that the handler exists. Here is my check definition in /etc/sensu/conf.d/checks/check_memory-metrics.json
{
“checks”: {
“memory-metrics”: {
“handlers”:[“default”, “influxdb”],
“type”: “metrics”,
“command”: “/etc/sensu/plugins/memory-metrics.rb”,
“subscribers”: [
“demo-server”
],
“interval”: 20
}
}
}
here is my handler in /etc/sensu/conf.d/handlers/handler-influxdb-metrics.json
{
“handlers”: {
“influxdb”: {
“type” : “pipe”,
“command” : “/etc/sensu/handlers/influxdb-metrics.rb”
}
}
}
This is just like the handler on my other functioning sensu server.
I restarted the sensu-server. As far as I understand, when this check runs on the client and receives a result, the handler should activate and run the command. This will send it to my influxDB.
However, in my logs, i see absolutely nothing about the handler. When I restart the sensu-server, it loads the handler and doesn’t give any errors. But then i simply see this over and over:
{“timestamp”:“2016-07-07T12:20:38.003310-0400”,“level”:“info”,“message”:“publishing check request”,“payload”:{“name”:“memory-metrics”,“issued”:1467908438,“command”:"/etc/sensu/plugins/memory-metrics.rb"},“subscribers”:[“demo-server”]}
{“timestamp”:“2016-07-07T12:20:49.876039-0400”,“level”:“info”,“message”:“pruning check result aggregations”}
With no mention of the handler, nor any errors giving insight into why it wouldn’t be working. Additionally, the sensu client logs have this output:
{“timestamp”:“2016-07-07T12:29:38.096689-0400”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“demo-sensu-server”,“check”:{“name”:“memory-metrics”,“issued”:1467908978,“command”:"/etc/sensu/plugins/memory-metrics.rb",“handlers”:[“default”,“influxdb”],“type”:“metrics”,“subscribers”:[“demo-server”],“interval”:20,“executed”:1467908978,“duration”:0.055,“output”:“tdrr-sensu-server.memory.total 3975749632 1467908978\ntdrr-sensu-server.memory.free 3464650752 1467908978\ntdrr-sensu-server.memory.buffers 970752 1467908978\ntdrr-sensu-server.memory.cached 170897408 1467908978\ntdrr-sensu-server.memory.swapTotal 4160745472 1467908978\ntdrr-sensu-server.memory.swapFree 4160745472 1467908978\ntdrr-sensu-server.memory.dirty 8192 1467908978\ntdrr-sensu-server.memory.swapUsed 0 1467908978\ntdrr-sensu-server.memory.used 511098880 1467908978\ntdrr-sensu-server.memory.usedWOBuffersCaches 339230720 1467908978\ntdrr-sensu-server.memory.freeWOBuffersCaches 3636518912 1467908978\ntdrr-sensu-server.memory.swapUsedPercentage 0 1467908978\n”,“status”:0}}}
Which have the influxdb handler in it.
Why does the handler simply seem to be unrecognized by the sensu server?
Thanks so much,
Dimitri