0

刚刚使用了 telegraf 和 influxdb 以及其他一些插件。但是 [[inputs.disk]] 的输出不会发送到 influx-database,尽管 telegraf-cli 会打印系列:

root@99a3dda91f0e:/# telegraf --config /etc/telegraf/telegraf.conf --test
* Plugin: inputs.disk, Collection 1
> disk,path=/,device=none,fstype=aufs,host=99a3dda91f0e,dockerhost=0zizhqemxr3fmhr949qqg94ly free=92858503168i,used=5304786944i,used_percent=5.404043546164225,inodes_total=6422528i,inodes_free=6192593i,inodes_used=229935i,total=103441399808i 1504273867000000000
> disk,path=/usr/share/zoneinfo/Etc/UTC,device=sda1,fstype=ext4,host=99a3dda91f0e,dockerhost=0zizhqemxr3fmhr949qqg94ly used=5304786944i,used_percent=5.404043546164225,inodes_total=6422528i,inodes_free=6192593i,inodes_used=229935i,total=103441399808i,free=92858503168i 1504273867000000000
> disk,path=/etc/resolv.conf,device=sda1,fstype=ext4,host=99a3dda91f0e,dockerhost=0zizhqemxr3fmhr949qqg94ly inodes_free=253014i,inodes_used=729i,total=207867904i,free=191041536i,used=16826368i,used_percent=8.094740783069618,inodes_total=253743i 1504273867000000000
> disk,path=/etc/hostname,device=sda1,fstype=ext4,host=99a3dda91f0e,dockerhost=0zizhqemxr3fmhr949qqg94ly total=103441399808i,free=92858503168i,used=5304786944i,used_percent=5.404043546164225,inodes_total=6422528i,inodes_free=6192593i,inodes_used=229935i 1504273867000000000
> disk,dockerhost=0zizhqemxr3fmhr949qqg94ly,path=/etc/hosts,device=sda1,fstype=ext4,host=99a3dda91f0e total=103441399808i,free=92858503168i,used=5304786944i,used_percent=5.404043546164225,inodes_total=6422528i,inodes_free=6192593i,inodes_used=229935i 1504273867000000000
* Plugin: inputs.kernel, Collection 1
> kernel,host=99a3dda91f0e,dockerhost=0zizhqemxr3fmhr949qqg94ly interrupts=38110293i,context_switches=66702050i,boot_time=1504190750i,processes_forked=227872i 1504273867000000000

涌入内:

> use monitoring
Using database monitoring
> show measurements
name: measurements
name
----
kernel
> 

电报配置:

[global_tags]
  host = "$HOSTNAME"
  dockerhost = "$DOCKERHOSTNAME"

# Configuration for telegraf agent
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = true
  logfile = ""
  hostname = ""
  omit_hostname = false

[[outputs.influxdb]]
  urls = ["http://influxdb:8086"] # required
  database = "$INFLUX_DATABASE"
  retention_policy = ""
  write_consistency = "any"
  timeout = "5s"

[[inputs.disk]]
  ## Setting mountpoints will restrict the stats to the specified mountpoints.
  # mount_points = ["/"]
  ## Ignore some mountpoints by filesystem type. For example (dev)tmpfs (usually
  ## present on /run, /var/run, /dev/shm or /dev).
  ignore_fs = ["tmpfs", "devtmpfs", "devfs"]

[[inputs.kernel]]

Telegraf v1.3.5 (git: release-1.3 7192e68b2423997177692834f53cdf171aee1a88)

InfluxDB v1.3.2 (git: 1.3 742b9cb3d74ff1be4aff45d69ee7c9ba66c02565)

//编辑:当然:

echo $INFLUX_DATABASE 
monitoring

如果我再次添加其他输入,例如 [[inputs.diskio]],它们会立即出现在数据库中。

4

1 回答 1

0

在 phusion/baseimage 中将 telegraf 作为运行脚本运行时似乎存在问题

于 2017-09-01T17:40:06.713 回答