# Collecting DATA with telegraf

**URL:** https://community.influxdata.com/t/collecting-data-with-telegraf/9587
**Category:** Telegraf
**Created:** [April 25, 2019, 5:53pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587 "2019-04-25T17:53:36Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 25, 2019, 5:53pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/1 "2019-04-25T17:53:36Z")

</div>

Hello,

i want to collect Data with telegraf which is in a Docker-Container(linux-Container) from a WINDOWS Server (Hyper-V), a Windows 10, a Ubiquiti WIFI System (SNMP) and a Synology NAS and a QNAP NAS, i am a starter in this and the collecting of my Docker-Containers (Metric) a runnig but no Windows or Others, can you help me?  
Here the telegraf.conf  
[global\_tags]  
[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 = false  
logfile = “”  
hostname = “”  
omit\_hostname = false  
[[outputs.influxdb]]  
urls = [“[http://influx:8086](http://influx:8086)”] # required  
database = “telegraf” # required  
username = “telegraf”  
password = “iijineeZ9iet”  
retention\_policy = “”  
write\_consistency = “any”  
timeout = “5s”  
##INPUTS##  
[[inputs.cpu]]  
percpu = true  
totalcpu = true  
collect\_cpu\_time = false  
report\_active = false  
[[inputs.mem]]  
[[inputs.swap]]  
[[inputs.netstat]]  
[[inputs.system]]  
[[inputs.docker]]  
endpoint = “unix:///var/run/docker.sock”  
[[inputs.ping]]  
urls = [“[www.google.com](http://www.google.com)”]  
count = 1  
# Read metrics about disk usage by mount point  
[[inputs.disk]]  
## By default, telegraf gather stats for all mountpoints.  
## 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"]
    [[inputs.processes]]
    [[inputs.net]]
    [[inputs.kernel]]
    [[inputs.linux_sysctl_fs]]
    [[inputs.diskio]]
    [[inputs.interrupts]]
    ##
    ## SNMP Input Plugin
    ##
    ## UniFi APs (Gen 2/Gen 3)
    ## Last update: 11 April 2017
    ##
     [[inputs.snmp]]
       # List of agents to poll
       agents = ["APBroFLORIAN", "uap2"]
       # Polling interval
       interval = "60s"
       # Timeout for each SNMP query.
       timeout = "10s"
       # Number of retries to attempt within timeout.
       retries = 3
       # SNMP version, UAP only supports v1
       version = 1
       # SNMP community string.
       community = "public"
       # The GETBULK max-repetitions parameter
       max_repetitions = 10
       # Measurement name
       name = "snmp.UAP"
       ##
       ## System Details
       ##
       # System name (hostname)
       [[inputs.snmp.field]]
         is_tag = true
         name = "sysName"
         oid = "RFC1213-MIB::sysName.0"
       # System vendor OID
       [[inputs.snmp.field]]
         name = "sysObjectID"
         oid = "RFC1213-MIB::sysObjectID.0"
       # System description
       [[inputs.snmp.field]]
         name = "sysDescr"
         oid = "RFC1213-MIB::sysDescr.0"
       # System contact
       [[inputs.snmp.field]]
         name = "sysContact"
         oid = "RFC1213-MIB::sysContact.0"
       # System location
       [[inputs.snmp.field]]
         name = "sysLocation"
         oid = "RFC1213-MIB::sysLocation.0"
       # System uptime
       [[inputs.snmp.field]]
         name = "sysUpTime"
         oid = "RFC1213-MIB::sysUpTime.0"
       # UAP model
       [[inputs.snmp.field]]
         name = "unifiApSystemModel"
         oid = "UBNT-UniFi-MIB::unifiApSystemModel"
       # UAP firmware version
       [[inputs.snmp.field]]
         name = "unifiApSystemVersion"
         oid = "UBNT-UniFi-MIB::unifiApSystemVersion"
       ##
       ## Host Resources
       ##
       # Total memory
       [[inputs.snmp.field]]
         name = "memTotal"
         oid = "FROGFOOT-RESOURCES-MIB::memTotal.0"
       # Free memory
       [[inputs.snmp.field]]
         name = "memFree"
         oid = "FROGFOOT-RESOURCES-MIB::memFree.0"
       # Buffer memory
       [[inputs.snmp.field]]
         name = "memBuffer"
         oid = "FROGFOOT-RESOURCES-MIB::memBuffer.0"
       # Cache memory
       [[inputs.snmp.field]]
         name = "memCache"
         oid = "FROGFOOT-RESOURCES-MIB::memCache.0"
       # Per-interface traffic, errors, drops
       [[inputs.snmp.table]]
         oid = "IF-MIB::ifTable"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "IF-MIB::ifDescr"
       ##
       ## Interface Details & Metrics
       ##
       # Wireless interfaces
       [[inputs.snmp.table]]
         oid = "UBNT-UniFi-MIB::unifiRadioTable"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "UBNT-UniFi-MIB::unifiRadioName"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "UBNT-UniFi-MIB::unifiRadioRadio"
       # BSS instances
       [[inputs.snmp.table]]
         oid = "UBNT-UniFi-MIB::unifiVapTable"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "UBNT-UniFi-MIB::unifiVapName"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "UBNT-UniFi-MIB::unifiVapRadio"
       # Ethernet interfaces
       [[inputs.snmp.table]]
         oid = "UBNT-UniFi-MIB::unifiIfTable"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "UBNT-UniFi-MIB::unifiIfName"
       ##
       ## System Performance
       ##
       # System load averages
       [[inputs.snmp.table]]
         oid = "FROGFOOT-RESOURCES-MIB::loadTable"
         [[inputs.snmp.table.field]]
           is_tag = true
           oid = "FROGFOOT-RESOURCES-MIB::loadDescr"
       ##
       ## SNMP metrics
       ##
       # Number of SNMP messages received
       [[inputs.snmp.field]]
         name = "snmpInPkts"
         oid = "SNMPv2-MIB::snmpInPkts.0"
       # Number of SNMP Get-Request received
       [[inputs.snmp.field]]
         name = "snmpInGetRequests"
         oid = "SNMPv2-MIB::snmpInGetRequests.0"
       # Number of SNMP Get-Next received
       [[inputs.snmp.field]]
         name = "snmpInGetNexts"
         oid = "SNMPv2-MIB::snmpInGetNexts.0"
       # Number of SNMP objects requested
       [[inputs.snmp.field]]
         name = "snmpInTotalReqVars"
         oid = "SNMPv2-MIB::snmpInTotalReqVars.0"
       # Number of SNMP Get-Response received
       [[inputs.snmp.field]]
         name = "snmpInGetResponses"
         oid = "SNMPv2-MIB::snmpInGetResponses.0"
       # Number of SNMP messages sent
       [[inputs.snmp.field]]
         name = "snmpOutPkts"
         oid = "SNMPv2-MIB::snmpOutPkts.0"
       # Number of SNMP Get-Request sent
       [[inputs.snmp.field]]
         name = "snmpOutGetRequests"
         oid = "SNMPv2-MIB::snmpOutGetRequests.0"
       # Number of SNMP Get-Next sent
       [[inputs.snmp.field]]
         name = "snmpOutGetNexts"
         oid = "SNMPv2-MIB::snmpOutGetNexts.0"
       # Number of SNMP Get-Response sent
       [[inputs.snmp.field]]
         name = "snmpOutGetResponses"
         oid = "SNMPv2-MIB::snmpOutGetResponses.0"
         
    [[inputs.win_perf_counters]]
      [[inputs.win_perf_counters.object]]
        # Processor usage, alternative to native, reports on a per core.
        ObjectName = "Processor"
        Instances = ["*"]
        Counters = [
          "% Idle Time",
          "% Interrupt Time",
          "% Privileged Time",
          "% User Time",
          "% Processor Time",
          "% DPC Time",
        ]
        Measurement = "win_cpu"
        # Set to true to include _Total instance when querying for all (*).
        IncludeTotal=true

      [[inputs.win_perf_counters.object]]
        # Disk times and queues
        ObjectName = "LogicalDisk"
        Instances = ["*"]
        Counters = [
          "% Idle Time",
          "% Disk Time",
          "% Disk Read Time",
          "% Disk Write Time",
          "Current Disk Queue Length",
          "% Free Space",
          "Free Megabytes",
        ]
        Measurement = "win_disk"
        # Set to true to include _Total instance when querying for all (*).
        #IncludeTotal=false

      [[inputs.win_perf_counters.object]]
        ObjectName = "PhysicalDisk"
        Instances = ["*"]
        Counters = [
          "Disk Read Bytes/sec",
          "Disk Write Bytes/sec",
          "Current Disk Queue Length",
          "Disk Reads/sec",
          "Disk Writes/sec",
          "% Disk Time",
          "% Disk Read Time",
          "% Disk Write Time",
        ]
        Measurement = "win_diskio"

      [[inputs.win_perf_counters.object]]
        ObjectName = "Network Interface"
        Instances = ["*"]
        Counters = [
          "Bytes Received/sec",
          "Bytes Sent/sec",
          "Packets Received/sec",
          "Packets Sent/sec",
          "Packets Received Discarded",
          "Packets Outbound Discarded",
          "Packets Received Errors",
          "Packets Outbound Errors",
        ]
        Measurement = "win_net"

      [[inputs.win_perf_counters.object]]
        ObjectName = "System"
        Counters = [
          "Context Switches/sec",
          "System Calls/sec",
          "Processor Queue Length",
          "System Up Time",
        ]
        Instances = ["------"]
        Measurement = "win_system"
        # Set to true to include _Total instance when querying for all (*).
        #IncludeTotal=false

      [[inputs.win_perf_counters.object]]
        # Example query where the Instance portion must be removed to get data back,
        # such as from the Memory object.
        ObjectName = "Memory"
        Counters = [
          "Available Bytes",
          "Cache Faults/sec",
          "Demand Zero Faults/sec",
          "Page Faults/sec",
          "Pages/sec",
          "Transition Faults/sec",
          "Pool Nonpaged Bytes",
          "Pool Paged Bytes",
          "Standby Cache Reserve Bytes",
          "Standby Cache Normal Priority Bytes",
          "Standby Cache Core Bytes",

        ]
        # Use 6 x - to remove the Instance bit from the query.
        Instances = ["------"]
        Measurement = "win_mem"
        # Set to true to include _Total instance when querying for all (*).
        #IncludeTotal=false

      [[inputs.win_perf_counters.object]]
        # Example query where the Instance portion must be removed to get data back,
        # such as from the Paging File object.
        ObjectName = "Paging File"
        Counters = [
          "% Usage",
        ]
        Instances = ["_Total"]
        Measurement = "win_swap"

```

I get this Message from Telegraf  
[telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, Undefined but requested input: win\_perf\_counter

And no data over snmp

---

<div class="post-metadata">

### Author: ![sebito91](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sebito91/32/42_2.png) [@sebito91](https://community.influxdata.com/u/sebito91)
#### Post date: [April 25, 2019, 7:38pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/2 "2019-04-25T19:38:53Z")

</div>

Where is your telegraf agent running, is it on the Windows machine that is hosting the docker container? Or from within the docker container?

Are you using the windows version of telegraf binaries if you are running telegraf on the Windows machine?

> **[Install Telegraf | Telegraf 1.21 Documentation](https://docs.influxdata.com/telegraf/v1.10/introduction/installation/)**
>
> Install Telegraf on your operating system.

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 25, 2019, 8:03pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/3 "2019-04-25T20:03:08Z")

</div>

With agent you mean the Programm which using telegraf. Conf  
the telegraf is running in a Linux docker container  
I can send the docker-compose.yml tommorow

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)
#### Post date: [April 25, 2019, 9:15pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/4 "2019-04-25T21:15:58Z")

</div>

The win\_perf\_counter plugin only works, and is only included, in the Windows build, as it uses pdh.dll under the hood.

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 25, 2019, 9:42pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/5 "2019-04-25T21:42:12Z")

</div>

Okay,  
what must I do to get data from a windows host/pc into the telegraf docker?

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)
#### Post date: [April 26, 2019, 12:59am UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/6 "2019-04-26T00:59:52Z")

</div>

The only way I know to get the performance counter data from within Docker is to use a Windows container. This has been reported to work at least on Windows 10 professional.  
[Unable to collect network metrics on Windows Container · Issue #5357 · influxdata/telegraf · GitHub](https://github.com/influxdata/telegraf/issues/5357)

It is potentially possible, and this is a real longshot, that somehow you could use wine. I haven’t talked to anyone crazy enough to try this though.

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 26, 2019, 5:19am UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/7 "2019-04-26T05:19:16Z")

</div>

Okay,

Or can I build the docker container for the influxdb, telegraf and grafana in the RealNetworks 192.168.178. 0 instead of 10.75.0.0 and instell the telegraf agent on windows and choose the output source the influxdb containers

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)
#### Post date: [April 26, 2019, 5:47pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/8 "2019-04-26T17:47:27Z")

</div>

I’m not sure I understand, but you could definitely run Telegraf on the real Windows host and send the data into the container running InfluxDB.

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 26, 2019, 5:59pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/9 "2019-04-26T17:59:11Z")

</div>

Yes,  
it works now, i can see Metrics from my Windows 10 PC and Windows 10 Notebook!  
But the snmp part didn’t work!  
I think I’m on the wrong track, because i put the snmp-Input part into the telegraf.conf from the Docker telegraf, but i think it is wrong!  
But what must i do, to Evaluate the data or to get the snmp data into the influxdb and than to see them in the grafa?

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)
#### Post date: [April 26, 2019, 10:39pm UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/10 "2019-04-26T22:39:33Z")

</div>

The official docker containers doesn’t contain the net-snmp tools needed for the snmp plugin. Here is a [comment](https://github.com/influxdata/influxdata-docker/issues/208#issuecomment-381793475) describing a way to rebuild the container with the extra bits. Keep an eye on the Telegraf logs to help with troubleshooting.

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 27, 2019, 10:22am UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/11 "2019-04-27T10:22:17Z")

</div>

Thank you it works, i see the status.  
Last Question  
I have a QNAP NAS System and i want to collcet data from there, but the telegraf don’t understand the QNAP SNMP, but i have the MIB?  
How can i get it into the telegraf?

---

<div class="post-metadata">

### Author: ![finchen1988](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@finchen1988](https://community.influxdata.com/u/finchen1988)
#### Post date: [April 28, 2019, 10:30am UTC](https://community.influxdata.com/t/collecting-data-with-telegraf/9587/12 "2019-04-28T10:30:22Z")

</div>

OKAY, i am getting the SNMP from my UBIQUITI!
