How to get "internal" Telegraf Plugin to work in Telegraf docker container

I am not able to get the Telegraf “internal” plugin to collect data inside the Telegraf docker container. Other plugins like docker, mem, cpu etc… works fine. Can you confirm if this plugin works for Telegraf docker? If yes, what am i missing in my docker command?

Here is my Ansible playbook to create the Telegraf container, running multiple telegraf instance per input listener.

  • name: Create Telegraf Container
    become: yes
    docker_container:
    name: telegraf-{{ item }}
    image: “{{ image_name }}”
    hostname: “{{ ansible_nodename }}_{{ item }}”
    restart_policy: always
    state: started
    published_ports: “{{ item }}:{{ item }}”
    exposed_ports: “{{ item }}/tcp”
    volumes:
    - /etc/telegraf/telegraf-{{ item }}.conf:/etc/telegraf/telegraf.conf:ro
    - /var/run/docker.sock:/var/run/docker.sock:ro
    - /sys:/rootfs/sys:ro
    - /proc:/rootfs/proc:ro
    - /etc:/rootfs/etc:ro
    with_items:
    • 8186
    • 8187
    • 8188
    • 8189
      notify:
    • wait for port {{ item }} status

I was able to get it work now…

1 Like

@Daniel_Li Glad to hear it!