Sensu截断输出字符串

时间:2015-08-21 08:45:16

标签: redis sensu

我有这个问题,其中sensu截断输出字符串长度约260个字符。我已经搜索了很长一段时间但找不到原因。

如果我将结果输出到sensu-client.log,则输出字符串不会被截断。但是当我在redis中检查时,它被截断了。

这是sensu-api / results的输出JSON:

[{"client":"test","check":{"command":"/etc/sensu/plugins/load-metrics.rb -s load","interval":120,"standalone":true,"name":"load-metrics","issued":1440145476,"executed":1440145476,"duration":0.117,"output":"load.load_avg.one 0.04 1440145476\nload.load_avg.five 0.01 1440145476\nload.load_avg.fifteen 0.00 1440145476\n\n","status":0}},{"client":"test","check":{"command":"/etc/sensu/plugins/memory-metrics.rb -s memory","interval":120,"standalone":true,"name":"memory-metrcis","issued":1440145481,"executed":1440145481,"duration":0.105,"output":"memory.total 1050628096 1440145481\nmemory.free 93421568 1440145481\nmemory.buffers 53370880 1440145481\nmemory.cached 482304000 1440145481\nmemory.swapTotal 2113921024 1440145481\nmemory.swapFree 2113921024 1440145481\nmemory.dirty 204800 1440145481\nmemory.swapU","status":0}},{"client":"test","check":{"command":"/etc/sensu/plugins/interface-metrics.rb -s interface","interval":120,"standalone":true,"name":"interface-metrics","issued":1440145496,"executed":1440145496,"duration":0.103,"output":"interface.lo.rxBytes 17062685 1440145496\ninterface.lo.rxPackets 80712 1440145496\ninterface.lo.rxErrors 0 1440145496\ninterface.lo.rxDrops 0 1440145496\ninterface.lo.rxFifo 0 1440145496\ninterface.lo.rxFrame 0 1440145496\ninterface.lo.rxCompressed 0 1440145496\ni","status":0}},{"client":"test","check":{"thresholds":{"warning":120,"critical":180},"name":"keepalive","issued":1440145470,"executed":1440145470,"output":"Keepalive sent from client 19 seconds ago","status":0}},{"client":"test","check":{"command":"/etc/sensu/plugins/disk-metrics.rb -s disk","interval":120,"standalone":true,"name":"disk-metrics","issued":1440145470,"executed":1440145470,"duration":0.098,"output":"disk.sda.reads 20589 1440145470\ndisk.sda.readsMerged 14159 1440145470\ndisk.sda.sectorsRead 971661 1440145470\ndisk.sda.readTime 234278 1440145470\ndisk.sda.writes 29582 1440145470\ndisk.sda.writesMerged 107721 1440145470\ndisk.sda.sectorsWritten 1098420 1440145","status":0}}]

我的环境如下:

  • Centos 5.3
  • Sensu 0.20
  • Redis 2.4.10
  • RabbitMQ 3.5.3

1 个答案:

答案 0 :(得分:0)

我找到了答案。罪魁祸首是sensu的源代码:lib / sensu / server / process.rb

OleDbDataAdapter