Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with defining win_perf_counters input #143

Open
czervenyvlk opened this issue Apr 16, 2020 · 1 comment
Open

Problem with defining win_perf_counters input #143

czervenyvlk opened this issue Apr 16, 2020 · 1 comment

Comments

@czervenyvlk
Copy link

czervenyvlk commented Apr 16, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.4.2
  • Ruby: embedded version
  • Distribution: Tested on windows2012/2016
  • Module version: 3.0.0

How to reproduce (e.g Puppet code you use)

  • The NetworkInterface win_perf_counter input is defined with following resource:
telegraf::input { 'NetworkInterface':
plugin_type => 'win_perf_counters.object',
options => [{
'ObjectName' => 'NetworkInterface',
'Instances' => ['*'],
'Counters' => [
'Bytes Received/sec',
'Bytes Sent/sec',
'Packets Received/sec',
'Packets Sent/sec',
],
'Measurement' => 'win_net',
'IncludeTotal' => false,
'tags' => {
'app' => 'metrics',
},
}]
}

What are you seeing

  • The resource will produce NetworkInterface.conf file as following but the config is wrong:
[[inputs."win_perf_counters.object"]]
Counters = ["Bytes Received/sec", "Bytes Sent/sec", "Packets Received/sec", "Packets Sent/sec"]
IncludeTotal = false
Instances = ["*"]
Measurement = "win_net"
ObjectName = "NetworkInterface"
[inputs."win_perf_counters.object".tags]
app = "metrics"

What behaviour did you expect instead

  • Down below is configuration snippet I'm expecting to see. Note the removed double quotes and tags section.
[[inputs.win_perf_counters.object]]
Counters = ["Bytes Received/sec", "Bytes Sent/sec", "Packets Received/sec", "Packets Sent/sec"]
IncludeTotal = false
Instances = ["*"]
Measurement = "win_net"
ObjectName = "NetworkInterface"
[inputs.win_perf_counters.tags]
app = "metrics"

Thanks for any help

@benh57
Copy link

benh57 commented Feb 11, 2021

Hey czervenyvlk,

As a workaround, try this setup via hiera as an example. Working for me.

telegraf::inputs:
  cpu:
    - percpu: true
      totalcpu: true
      fielddrop: ["time_*"]
  mem: [{}]
  io: [{}]
  net: [{}]
  disk: [{}]
  swap: [{}]
  system: [{}]
  win_perf_counters:
    - object:
      - ObjectName: "Processor"
        Counters: ["% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time"]
        Instances: ["*"]
        Measurement: "win_cpu"
    - object:
      - ObjectName: "System"
        Counters: [ "System Up Time", "Processes" ]
        Instances: ["*"]
        Measurement: "win_system"
    - object:
      - ObjectName: "LogicalDisk"
        Counters: ["% Idle Time", "% Disk Time","% Disk Read Time", "% Disk Write Time", "% User Time", "Current Disk Queue Length"]
        Instances: ["*"]
        Measurement: "win_disk"
    - object:
      - ObjectName: "TCPv4"
        Counters: ["Connections Established", "Connections Reset"]

        Instances: ["*"]
        Measurement: "win_net"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants