telegraf
telegraf copied to clipboard
Docker plugin not working on Amazon Linux (EC2/ECS)
Similar to #84
[ec2-user@ip-10-0-0-160 /]$ /opt/telegraf/telegraf -version
Telegraf - Version 0.2.4
[ec2-user@ip-10-0-0-160 /]$ docker -v
Docker version 1.9.1, build a34a1d5/1.9.1
[ec2-user@ip-10-0-0-160 /]$ uname -a
Linux ip-10-0-0-160 4.1.13-18.26.amzn1.x86_64 #1 SMP Mon Nov 23 05:35:56 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Per http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html:
... For Amazon Linux, this path is /cgroup; for many other operating systems, this path is /sys/fs/cgroup, but you should verify the path in your specific OS documentation.
[ec2-user@ip-10-0-0-160 /]$ grep docker /var/log/telegraf/telegraf.log | tail -1
2016/01/10 23:49:20 Error in plugin [docker]: error getting docker info: open /sys/fs/cgroup/cpuacct/system.slice/docker-433bfe61b652993b2760305264e5be3fc8f8768ea47f5041d02d1fbff5761f0b.scope/cpuacct.stat: no such file or directory
[ec2-user@ip-10-0-0-160 /]$ ls /sys/fs/cgroup/
[ec2-user@ip-10-0-0-160 /]$ ls /cgroup/
blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event
The docker plugin config ought to take a base path so that the cgroup directory can be read correctly on distros that don't place it in the standard /sys/fs/cgroup
https://github.com/influxdata/telegraf/blob/master/plugins/system/ps.go#L145