Merge "Support monitoring for bond interfaces via telegraf"
diff --git a/linux/files/telegraf.conf b/linux/files/telegraf.conf
new file mode 100644
index 0000000..6a45b6b
--- /dev/null
+++ b/linux/files/telegraf.conf
@@ -0,0 +1,9 @@
+[[inputs.bond]]
+{%- include 'telegraf/files/input/_common.conf' %}
+{%- if values.bond_interfaces is defined %}
+ bond_interfaces = {{ values.bond_interfaces | json }}
+{%- endif %}
+{%- if values.host_proc is defined %}
+ host_proc = "{{ values.host_proc | json }}"
+{%- endif %}
+{%- include 'telegraf/files/input/_filters.conf' %}
diff --git a/linux/meta/telegraf.yml b/linux/meta/telegraf.yml
index 45fef5c..854bf26 100644
--- a/linux/meta/telegraf.yml
+++ b/linux/meta/telegraf.yml
@@ -1,3 +1,4 @@
+{%- from "linux/map.jinja" import monitoring with context %}
agent:
input:
cpu:
@@ -23,3 +24,13 @@
swap:
system:
linux_sysctl_fs:
+{%- if monitoring.bond_status.interfaces is defined and monitoring.bond_status.interfaces %}
+ bond:
+ template: linux/files/telegraf.conf
+{%- if monitoring.bond_status.interfaces is list %}
+ bond_interfaces: {{ monitoring.bond_status.interfaces }}
+{%- endif %}
+{%- if monitoring.bond_status.host_proc is defined %}
+ host_proc: {{ monitoring.bond_status.host_proc }}
+{%- endif %}
+{%- endif %}