From 8d442b2aafb005a8a6d1a8c65f7fd426c660acbc Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 23 Dec 2020 20:54:48 -0600 Subject: [PATCH] roles/collectd: Support setting server interface For hosts with multiple network interfaces, collectd may not send multicast messages through the correct interface. To ensure that it does, the `Interface` configuration option can be specified with each `Server` option. To define this option, entries in the `collectd_network_servers` list can now have an `interface` property. --- roles/collectd/templates/collectd-network.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/collectd/templates/collectd-network.conf.j2 b/roles/collectd/templates/collectd-network.conf.j2 index 177d9f2..27654bd 100644 --- a/roles/collectd/templates/collectd-network.conf.j2 +++ b/roles/collectd/templates/collectd-network.conf.j2 @@ -6,6 +6,10 @@ LoadPlugin network {% for server in collectd_network_servers %} {% if server is string %} Server "{{ server }}" +{% elif server.interface is defined %} + + Interface "{{ server.interface }}" + {% else %} Server "{{ server.host }}" {{ server.port }} {% endif %}