[freeze break request] Add ResolveInterval option to collectd clients

Ricky Elrod codeblock at elrod.me
Mon May 25 19:45:06 UTC 2015


Per IRC, Kevin point out that this is too new for our RHEL6 collectd
version.

Updated patch to make it conditional:

commit c5ae02db25c23304c9c7f76158b04c60a8dfaa39
Author: Ricky Elrod <codeblock at fedoraproject.org>
Date:   Mon May 25 03:33:34 2015 +0000

    [collectd/base] re-resolve dns lookup after a few hours if it fails

    see: https://github.com/collectd/collectd/pull/732

    Signed-off-by: Ricky Elrod <codeblock at fedoraproject.org>

diff --git a/roles/collectd/base/files/network-client.conf
b/roles/collectd/base/files/network-client.conf
deleted file mode 100644
index a6bd125..0000000
--- a/roles/collectd/base/files/network-client.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-LoadPlugin network
-
-<Plugin "network">
-        Server "log01"
-</Plugin>
diff --git a/roles/collectd/base/tasks/main.yml
b/roles/collectd/base/tasks/main.yml
index 210e7d9..8e342a1 100644
--- a/roles/collectd/base/tasks/main.yml
+++ b/roles/collectd/base/tasks/main.yml
@@ -23,7 +23,7 @@

 # install collectd-network config
 - name: /etc/collectd.d/network.conf
-  copy: src=network-client.conf dest=/etc/collectd.d/network.conf
+  template: src=network-client.conf.j2 dest=/etc/collectd.d/network.conf
   tags:
   - collectd
   notify:
diff --git a/roles/collectd/base/templates/network-client.conf.j2
b/roles/collectd/base/templates/network-client.conf.j2
new file mode 100644
index 0000000..e39c76f
--- /dev/null
+++ b/roles/collectd/base/templates/network-client.conf.j2
@@ -0,0 +1,8 @@
+LoadPlugin network
+
+<Plugin "network">
+        Server "log01"
+        {% if ansible_distribution_major_version != '6' %}
+        ResolveInterval 14400
+        {% endif %}
+</Plugin>





On 05/24/2015 11:36 PM, Ricky Elrod wrote:
> By default collectd's Network module won't attempt to re-resolve
> hostnames if it fails for some reason (e.g. network not being available
> when it's first started).
> 
> However there's a fairly recently added option called ResolveInterval
> which will force it to re-resolve after N seconds if it fails. The
> example in the collectd repo uses 4 hours (14400 seconds) so I used
> that, but we could probably bump it down a bit if we wanted.
> 
> Patch follows.
> 
> commit 34138a9e598a4fad54380ef692d70c71d7e08e41
> Author: Ricky Elrod <codeblock at fedoraproject.org>
> Date:   Mon May 25 03:33:34 2015 +0000
> 
>     [collectd/base] re-resolve dns lookup after a few hours if it fails
> 
>     see: https://github.com/collectd/collectd/pull/732
> 
>     Signed-off-by: Ricky Elrod <codeblock at fedoraproject.org>
> 
> diff --git a/roles/collectd/base/files/network-client.conf
> b/roles/collectd/base/files/network-client.conf
> index a6bd125..53f74b7 100644
> --- a/roles/collectd/base/files/network-client.conf
> +++ b/roles/collectd/base/files/network-client.conf
> @@ -2,4 +2,5 @@ LoadPlugin network
> 
>  <Plugin "network">
>          Server "log01"
> +        ResolveInterval 14400
>  </Plugin>
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20150525/8fa709a4/attachment-0001.sig>


More information about the infrastructure mailing list