Telegraf: Input - Windows Performance Counters

Aus Wiki-WebPerfect
Version vom 8. Februar 2022, 09:45 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche


Error

E! [telegraf] Error running agent: Error loading config file <PATH_TO_YOUR_CONFIG>.conf: Error parsing data: line x: table `inputs.win_perf_counters.tags' is in conflict with table in line x


Cause

This is because of an syntax error. You will setting two different tags on the same win_perf_stanza (inputs.win_perf_counters).
In the Telegraf input plugin "win_perf_counters" you cannot set the tags under the inputs.win_perf_counters.'''object''' stanza.
You have to set the tags under the inputs.win_perf_counters stanza and cannot define it twice like the following image:
01-telegraf win perf counters wrong tag.png


Solution




inputs.win_perf_counters

 inputs.win_perf_counters.object
   ObjectName = "Hyper-V Hypervisor Virtual Processor"
   Instances = ["*"]
   Counters = [
     "Hypercalls/sec",
   ]
   Measurement = "hyperv_vm_hypercalls_demo"

[inputs.win_perf_counters.tags]

     TestTag = "testvalue1"

inputs.win_perf_counters

 inputs.win_perf_counters.object
   ObjectName = "Hyper-V Hypervisor Virtual Processor"
   Instances = ["*"]
   Counters = [
     "Hypercalls/sec",
   ]
   Measurement = "hyperv_vm_hypercalls_demo"

[inputs.win_perf_counters.tags]

     TestTag = "testvalue2"