dj-wasabi / ansible-telegraf

Installing and configuring Telegraf via Ansible for RedHat/Debian/Ubuntu/Windows/Suse.
MIT License
134 stars 116 forks source link

A few enhancements and fixes to windows support #73

Closed jdivy closed 5 years ago

jdivy commented 5 years ago

Description of PR I found it helpful to explicitly support what telegraf expects when defining win_perf_counters plugin objects as defined in their docs. I don't particularly like the fact that a new objects property is effectively hijacked for use with the win_perf_counters plugin exclusively, but if you have other ideas on how to handle that let me know - don't want to break compatibility with linux config etc.

I also discovered a small bug in the definition of the windows plugin includes directory (just needed to use the variable)

My definition for a win_perf_counter plugin now looks like this instead of having to define line items in a list of configs to get multiple objects in the template:

telegraf_plugins_default:
  - plugin: win_perf_counters
    config:
      - UsePerfCounterTime = true
    objects:
      - name: Processor
        measurement: win_cpu
        counters:
          - "% User Time"
          - "% Processor Time"
        total: true

      - name: System
        measurement: win_system
        instances: ["------"]
        counters:
          - "Processes"
          - "Threads"

Type of change

Feature Pull Request Bugfix Pull Request

dj-wasabi commented 5 years ago

lgtm 👍 And the Travis test don't complain about a breaking Linux config, so will merge it. Thanks!