Merge pull request #73 from jdivy/windows

A few enhancements and fixes to windows support
This commit is contained in:
Werner Dijkerman
2018-12-09 20:21:45 +01:00
committed by GitHub
3 changed files with 13 additions and 3 deletions

View File

@ -57,7 +57,7 @@ telegraf_redhat_releasever: "$releasever"
telegraf_win_install_dir: 'C:\Telegraf'
telegraf_win_logfile: 'C:\\Telegraf\\telegraf.log'
telegraf_win_include: 'C:\Telegraf\telegraf_agent.d\'
telegraf_win_include: 'C:\Telegraf\telegraf_agent.d'
telegraf_win_service_args:
- -service install
- -config {{ telegraf_win_install_dir }}\telegraf\telegraf.conf

View File

@ -35,7 +35,7 @@
- name: "Windows | Copy telegraf extra plugins"
win_template:
src: "telegraf-extra-plugin.conf.j2"
dest: "/etc/telegraf/telegraf.d/{{ item.key }}.conf"
dest: '{{ telegraf_win_include }}\{{ item.key }}.conf'
with_dict: "{{ telegraf_plugins_extra }}"
loop_control:
label: "{{ item.key }}"
@ -47,7 +47,7 @@
- name: "Windows | Remove telegraf extra plugins"
win_file:
path: "/etc/telegraf/telegraf.d/{{ item.key }}.conf"
path: '{{ telegraf_win_include }}\{{ item.key }}.conf'
state: absent
with_dict: "{{ telegraf_plugins_extra }}"
loop_control:

View File

@ -94,6 +94,16 @@
{{ items }}
{% endfor %}
{% endif %}
{% if item.objects is defined and item.objects is iterable %}
{% for object in item.objects %}
[[inputs.{{ item.plugin }}.object]]
ObjectName = {{ object.name | tojson }}
Instances = {{ object.instances | default(["*"]) }}
Counters = {{ object.counters | default(["*"]) }}
Measurement = {{ object.measurement | default("win_perf_counters") | tojson }}
IncludeTotal = {{ object.total | default(false) | string | lower }}
{% endfor %}
{% endif %}
{% if item.specifications is defined and item.specifications is iterable %}
[[{{item.plugin}}.specifications]]
{% for items in item.specifications %}