Influxdb 配置Sensu以在XDB中发送度量

Influxdb 配置Sensu以在XDB中发送度量,influxdb,sensu,Influxdb,Sensu,我正在尝试使用sensu将度量发送到UDP中的XDB 我设置了我的XDB数据库: # echo "cpu value=1" | nc -C -w 1 -u localhost 8089 # echo "select * from cpu" | influx -database sensu name: cpu time value 1490898218118704438 1 我从存储库安装了插件: 根据单据配置处理程序: { "handlers": { "inf

我正在尝试使用sensu将度量发送到UDP中的XDB

我设置了我的XDB数据库:

# echo "cpu value=1" | nc -C -w 1 -u localhost 8089
# echo "select * from cpu" | influx -database sensu
name: cpu
time                value
1490898218118704438 1
我从存储库安装了插件:

根据单据配置处理程序:

{
"handlers": {
  "influxdb": {
    "type": "udp",
    "socket": {
      "host": "localhost",
      "port": 8089
    },
    "mutator": "influxdb_line_protocol"
  }
  }
并将检查配置为使用此处理程序:

{
"checks": {
  "cpu-metrics": {
    "command": "/opt/sensu/embedded/bin/metrics-cpu-pcnt-usage.rb",
    "handlers": [
      "influxdb"
    ],
    "interval": 60,
    "subscribers": [
      "production"
    ],
    "type": "metric",
    "standalone": false
  }
}
}
现在,当我重新启动sensu服务器时,我可以看到加载的扩展:

{时间戳:2017-03-30T19:53:05.083622+0000,级别:警告,消息:加载的扩展,类型:mutator,名称:influxdb_line_protocol,描述:返回针对influxdb的line protocol格式化的检查输出}

我可以看到客户端收集的指标:

{时间戳:2017-03-30T20:08:49.940732+0000,级别:信息,消息:收到检查请求,检查:{命令:/opt/sensu/embedded/bin/metrics cpu pcnt usage.rb,处理程序:[influxdb],类型:metric,standalone:false,名称:cpu metrics,发出:1490904529} {时间戳:2017-03-30T20:08:51.150984+0000,级别:信息,消息:发布检查结果,有效负载:{客户端:nott,检查:{命令:/opt/sensu/embedded/bin/metrics cpu pcnt用法.rb,处理程序:[度量],类型:度量,独立:false,名称:cpu度量,发布:1490904529,间隔:60,订阅者:[生产],已执行:1490904529,持续时间:1.21,输出:nott.cpu.user 0.25 1490904531\nnott.cpu.nice 0.00 1490904531\nnott.cpu.system 0.00 1490904531\nnott.cpu.idle 99.25 1490904531\nnott.cpu.iowait 0.00 1490904531\nnott.cpu.irq 0.00 1490904531\nnott.cpu.softirq 0.00 1490904531\nnott.cpu.cpu.0.50 1490904531\nnott.cpu.0\nott\nott\nott\nott\nott},guest状态}

但我的XDB数据库中仍然没有其他内容

influx -database sensu
Connected to http://localhost:8086 version 1.2.1
InfluxDB shell version: 1.2.1
> show measurements;
name: measurements
name
----
cpu
有什么见解吗

更新:根据评论中的要求,这里是我的XDB UDP配置:

[[udp]]
  enabled = true
  bind-address = "127.0.0.1:8089"
  database = "sensu"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "1s"
  read-buffer = 0
更新2:如果添加调试处理程序,我可以在服务器日志中看到度量检查的结果:

{时间戳:2017-04-15T13:05:46.047354+0000,级别:信息,消息:处理程序扩展输出,扩展:{type:extension,name:debug},事件:{id:1303c9d3-096c-4744-9fdc-9566c831270c},输出:{\client\:{\name\:\nott\,\address\:\127.0.1\,\environment\:\production\,\subscriptions\,\certsubscriptions\[\s\,\production\,\client:nott\,\socket{\bind\:\127.0.0.1\,\port\:3030},\version\:\0.28.2\,\timestamp\:1492261543},\check\:{\command\:\/opt/sensu/embedded/bin/metrics cpu pcnt usage.rb\,\handlers\:[\metrics\],\interval\:60,\subscribers\:[\production\],\type\:\metric\,\standalone\:true、\name\:\cpu metrics\,\issued\:1492261544、\executed\:1492261544、\duration\:1.205、\output\:\nott.cpu.user 0.75 1492261546\nott.cpu.nice 0.00 1492261546\nott.cpu.idle 99.00 1492261546\nott.cpu.iowait 0.00 1492261546\nott.cpu.cpu.irq 0.00nott.cpu.steal 0.25 1492261546\nott.cpu.guest 0.00 1492261546\n\,\status\:0,\history\:[\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,\0\,总状态变化\:0},\employments\:1、\employments\u watermark\:1、\action\:\create\,\timestamp\:149261546、\id\:\1303c9d3-096c-4744-9fdc-9566c831270c\,\last\u ok\:149261546、\sulleted\:false、\sulleted\u by\:[],状态:0}

但是我在环回上的porr 8089上没有看到任何交换。

我也有同样的问题。
在influxdb.conf文件中将行精度=s添加到UDP块后,问题得到了解决。

是否启用并配置了influxdb配置文件的UDP部分?我用配置更新了配置,但当我这样做时,echo cpu值=1 | nc-C-w 1-u localhost 8089,我实际上在右端口的数据库中注入了UDP数据。因此influxdb工作。
[[udp]]
  enabled = true
  bind-address = "127.0.0.1:8089"
  database = "sensu"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "1s"
  read-buffer = 0