Skip to content

Commit

Permalink
Cleanup config files
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Apr 20, 2019
1 parent 3defa8e commit 27d6ed3
Show file tree
Hide file tree
Showing 43 changed files with 258 additions and 327 deletions.
46 changes: 22 additions & 24 deletions collectd/files/apache.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,29 +8,28 @@

LoadPlugin apache

<Plugin apache>

<Plugin "apache">
{%- for instance in collectd_settings.plugins.apache.instances %}
<Instance "{{ instance.name }}">
URL "{{ instance.url }}"
{%- if instance.user is defined and instance.user %}
User "{{ instance.user }}"
{%- endif -%}
{% if instance.pass is defined and instance.pass %}
Password "{{ instance.pass }}"
{%- endif -%}
{% if instance.verifypeer is defined and instance.verifypeer %}
VerifyPeer {{ instance.verifypeer }}
{%- endif -%}
{% if instance.verifyhost is defined and instance.verifyhost %}
VerifyHost {{ instance.verifyhost | lower }}
{%- endif -%}
{% if instance.cacert is defined and instance.cacert %}
CACert "{{ instance.cacert }}"
{%- endif -%}
{% if instance.server is defined and instance.server %}
Server "{{ instance.server }}"
{% endif %}
</Instance>
<Instance "{{ instance.name }}">
URL "{{ instance.url }}"
{%- if instance.user is defined and instance.user %}
User "{{ instance.user }}"
{%- endif %}
{%- if instance.pass is defined and instance.pass %}
Password "{{ instance.pass }}"
{%- endif %}
{%- if instance.verifypeer is defined and instance.verifypeer %}
VerifyPeer {{ instance.verifypeer }}
{%- endif %}
{%- if instance.verifyhost is defined and instance.verifyhost %}
VerifyHost {{ instance.verifyhost | lower }}
{%- endif %}
{%- if instance.cacert is defined and instance.cacert %}
CACert "{{ instance.cacert }}"
{%- endif %}
{%- if instance.server is defined and instance.server %}
Server "{{ instance.server }}"
{% endif %}
</Instance>
{%- endfor %}
</Plugin>
65 changes: 32 additions & 33 deletions collectd/files/bind.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,42 +8,42 @@

LoadPlugin bind

<Plugin bind>
URL "{{ collectd_settings.plugins.bind.proto }}://{{ collectd_settings.plugins.bind.host }}:{{ collectd_settings.plugins.bind.port }}/"
ParseTime {{ collectd_settings.plugins.bind.parsetime | lower }}
OpCodes {{ collectd_settings.plugins.bind.opcodes | lower }}
QTypes {{ collectd_settings.plugins.bind.qtypes | lower }}
<Plugin "bind">
URL "{{ collectd_settings.plugins.bind.proto }}://{{ collectd_settings.plugins.bind.host }}:{{ collectd_settings.plugins.bind.port }}/"
ParseTime {{ collectd_settings.plugins.bind.parsetime | lower }}
OpCodes {{ collectd_settings.plugins.bind.opcodes | lower }}
QTypes {{ collectd_settings.plugins.bind.qtypes | lower }}

ServerStats {{ collectd_settings.plugins.bind.serverstats | lower }}
ZoneMaintStats {{ collectd_settings.plugins.bind.zonemaintstats | lower }}
ResolverStats {{ collectd_settings.plugins.bind.resolverstats | lower }}
MemoryStats {{ collectd_settings.plugins.bind.memorystats | lower }}
ServerStats {{ collectd_settings.plugins.bind.serverstats | lower }}
ZoneMaintStats {{ collectd_settings.plugins.bind.zonemaintstats | lower }}
ResolverStats {{ collectd_settings.plugins.bind.resolverstats | lower }}
MemoryStats {{ collectd_settings.plugins.bind.memorystats | lower }}

{%- if collectd_settings.plugins.bind.views is defined %}
{% for view in collectd_settings.plugins.bind.views %}
<View "{{ view.name }}">
{%- if view.qtypes is defined %}
QTypes {{ view.qtypes | lower }}
{%- else %}
QTypes true
{%- endif %}
{%- if view.resolverstats is defined %}
ResolverStats {{ view.resolverstats | lower }}
{%- else %}
ResolverStats true
{%- endif %}
{%- if view.cacherrsets is defined %}
CacheRRSets {{ view.cacherrsets | lower }}
{%- else %}
CacheRRSets true
{%- endif %}
{% for view in collectd_settings.plugins.bind.views %}
<View "{{ view.name }}">
{%- if view.qtypes is defined %}
QTypes {{ view.qtypes | lower }}
{%- else %}
QTypes true
{%- endif %}
{%- if view.resolverstats is defined %}
ResolverStats {{ view.resolverstats | lower }}
{%- else %}
ResolverStats true
{%- endif %}
{%- if view.cacherrsets is defined %}
CacheRRSets {{ view.cacherrsets | lower }}
{%- else %}
CacheRRSets true
{%- endif %}

{%- if view.zones is defined %}
{% for zone in view.zones %}
Zone "{{ zone }}"
{%- endfor %}
{%- endif %}
</View>
{%- if view.zones is defined %}
{% for zone in view.zones %}
Zone "{{ zone }}"
{%- endfor %}
{%- endif %}
</View>
{%- endfor %}
{%- endif %}
</Plugin>
11 changes: 3 additions & 8 deletions collectd/files/collectd.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context -%}

{%- from "collectd/map.jinja" import collectd_settings with context %}
#
# DO NOT EDIT
#
Expand All @@ -9,19 +8,15 @@

Hostname "{{ collectd_settings.Hostname }}"
FQDNLookup {{ collectd_settings.FQDNLookup }}
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"

{% for type in collectd_settings.TypesDB %}
TypesDB "{{ type }}"
{%- endfor %}
Interval {{ collectd_settings.Interval }}
Timeout {{ collectd_settings.Timeout }}
ReadThreads {{ collectd_settings.ReadThreads }}
WriteQueueLimitHigh {{ collectd_settings.WriteQueueLimitHigh }}
WriteQueueLimitLow {{ collectd_settings.WriteQueueLimitLow }}
WriteQueueLimitHigh {{ collectd_settings.WriteQueueLimitHigh }}
WriteQueueLimitLow {{ collectd_settings.WriteQueueLimitLow }}
CollectInternalStats {{ collectd_settings.CollectInternalStats }}



Include "{{ collectd_settings.plugindirconfig }}/*.conf"
3 changes: 1 addition & 2 deletions collectd/files/curl_json.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,7 +8,7 @@

LoadPlugin curl_json

<Plugin curl_json>
<Plugin "curl_json">
{% for block, block_data in collectd_settings.plugins.curl_json.items() %}
<{{ block }}>
{%- if block_data.instance is defined %}
Expand Down
3 changes: 1 addition & 2 deletions collectd/files/curl_xml.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,7 +8,7 @@

LoadPlugin curl_xml

<Plugin curl_xml>
<Plugin "curl_xml">
{% for block, block_data in collectd_settings.plugins.curl_xml.items() %}
<{{ block }}>
{%- if block_data.host is defined %}
Expand Down
5 changes: 2 additions & 3 deletions collectd/files/dbi.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,8 +8,8 @@

LoadPlugin dbi

<Plugin dbi>
{%- for query in collectd_settings.plugins.dbi.queries %}
<Plugin "dbi">
{%- for query in collectd_settings.plugins.dbi.queries %}
<Query {{ query.name }}>
Statement "{{ query.statement }}"
{%- for res in query.results %}
Expand Down
3 changes: 1 addition & 2 deletions collectd/files/default.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context -%}
{%- from "collectd/map.jinja" import collectd_settings with context %}
#
# DO NOT EDIT
#
Expand All @@ -7,7 +7,6 @@
#
# Loaded by collectd.conf (Include {{ collectd_settings.plugindirconfig }}/*.conf)


{% for plugin in collectd_settings.plugins.default %}
LoadPlugin {{ plugin }}
{%- endfor %}
31 changes: 15 additions & 16 deletions collectd/files/df.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -10,29 +9,29 @@
LoadPlugin df

{%- if collectd_settings.plugins.df.Device is defined and collectd_settings.plugins.df.Device %}
{%- do collectd_settings.plugins.df.Devices.append(collectd_settings.plugins.df.Device) %} {# backwards compat #}
{%- do collectd_settings.plugins.df.Devices.append(collectd_settings.plugins.df.Device) %} {# backwards compat #}
{%- endif %}

<Plugin df>
<Plugin "df">
{%- for device in collectd_settings.plugins.df.Devices %}
Device "{{ device }}"
Device "{{ device }}"
{%- endfor %}
{%- if collectd_settings.plugins.df.MountPoints is defined and collectd_settings.plugins.df.MountPoints %}
{%- for mountpoint in collectd_settings.plugins.df.MountPoints %}
MountPoint "{{ mountpoint }}"
{%- endfor %}
{%- for mountpoint in collectd_settings.plugins.df.MountPoints %}
MountPoint "{{ mountpoint }}"
{%- endfor %}
{%- endif %}
{%- if collectd_settings.plugins.df.FSTypes is defined and collectd_settings.plugins.df.FSTypes %}
{%- for fstype in collectd_settings.plugins.df.FSTypes %}
FSType "{{ fstype }}"
{%- endfor %}
{%- for fstype in collectd_settings.plugins.df.FSTypes %}
FSType "{{ fstype }}"
{%- endfor %}
{%- endif %}
IgnoreSelected "{{ collectd_settings.plugins.df.IgnoreSelected|lower }}"
ReportByDevice "{{ collectd_settings.plugins.df.ReportByDevice|lower }}"
IgnoreSelected "{{ collectd_settings.plugins.df.IgnoreSelected|lower }}"
ReportByDevice "{{ collectd_settings.plugins.df.ReportByDevice|lower }}"
{%- if not collectd_settings.plugins.df.disable_report_reserved %}
# ReportReserved is only supported in old versions of collectd
ReportReserved "{{ collectd_settings.plugins.df.ReportReserved|lower }}"
# ReportReserved is only supported in old versions of collectd
ReportReserved "{{ collectd_settings.plugins.df.ReportReserved|lower }}"
{%- endif %}
ReportInodes "{{ collectd_settings.plugins.df.ReportInodes|lower }}"
ValuesPercentage "{{ collectd_settings.plugins.df.ValuesPercentage|lower }}"
ReportInodes "{{ collectd_settings.plugins.df.ReportInodes|lower }}"
ValuesPercentage "{{ collectd_settings.plugins.df.ValuesPercentage|lower }}"
</Plugin>
7 changes: 3 additions & 4 deletions collectd/files/disk.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,9 +8,9 @@

LoadPlugin disk

<Plugin disk>
<Plugin "disk">
{%- for match in collectd_settings.plugins.disk.matches %}
Disk "{{ match}}"
Disk "{{ match}}"
{%- endfor %}
IgnoreSelected "{{ collectd_settings.plugins.disk.IgnoreSelected }}"
IgnoreSelected "{{ collectd_settings.plugins.disk.IgnoreSelected }}"
</Plugin>
28 changes: 16 additions & 12 deletions collectd/files/elasticsearch.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}
#
# DO NOT EDIT
#
# This file is managed by salt via {{ source }}
# Modify the config that generates this file instead
#

<LoadPlugin "python">
Globals true
Globals true
</LoadPlugin>

<Plugin "python">
ModulePath "{{ collectd_settings.moduledirconfig }}"

Import "elasticsearch"

<Module "elasticsearch">
Host {{ collectd_settings.plugins.elasticsearch.host }}
Port {{ collectd_settings.plugins.elasticsearch.port }}
Verbose {{ collectd_settings.plugins.elasticsearch.verbose }}
Version "{{ collectd_settings.plugins.elasticsearch.version }}"
Cluster "{{ collectd_settings.plugins.elasticsearch.cluster }}"
</Module>
ModulePath "{{ collectd_settings.moduledirconfig }}"
Import "elasticsearch"
<Module "elasticsearch">
Host {{ collectd_settings.plugins.elasticsearch.host }}
Port {{ collectd_settings.plugins.elasticsearch.port }}
Verbose {{ collectd_settings.plugins.elasticsearch.verbose }}
Version "{{ collectd_settings.plugins.elasticsearch.version }}"
Cluster "{{ collectd_settings.plugins.elasticsearch.cluster }}"
</Module>
</Plugin>
1 change: 0 additions & 1 deletion collectd/files/ethstat.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand Down
1 change: 0 additions & 1 deletion collectd/files/exec.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand Down
1 change: 0 additions & 1 deletion collectd/files/interface.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand Down
1 change: 0 additions & 1 deletion collectd/files/java.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand Down
4 changes: 1 addition & 3 deletions collectd/files/librato.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,8 +8,7 @@

LoadPlugin write_http


<Plugin write_http>
<Plugin "write_http">
<URL "https://collectd.librato.com/v1/measurements">
User "{{ collectd_settings.plugins.librato.user }}"
Password "{{ collectd_settings.plugins.librato.token }}"
Expand Down
1 change: 0 additions & 1 deletion collectd/files/logfile.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand Down
7 changes: 3 additions & 4 deletions collectd/files/md.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}

#
# DO NOT EDIT
#
Expand All @@ -9,9 +8,9 @@

LoadPlugin md

<Plugin md>
<Plugin "md">
{%- for device in collectd_settings.plugins.md.Devices %}
Device "{{ device }}"
Device "{{ device }}"
{%- endfor %}
IgnoreSelected "{{ collectd_settings.plugins.md.IgnoreSelected }}"
IgnoreSelected "{{ collectd_settings.plugins.md.IgnoreSelected }}"
</Plugin>
Loading

0 comments on commit 27d6ed3

Please sign in to comment.