From 27d6ed39431da53d49077dbd7f34ff6e833da7b7 Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Sat, 20 Apr 2019 01:25:11 +0200 Subject: [PATCH] Cleanup config files --- collectd/files/apache.conf | 46 +++++++++---------- collectd/files/bind.conf | 65 +++++++++++++------------- collectd/files/collectd.conf | 11 ++--- collectd/files/curl_json.conf | 3 +- collectd/files/curl_xml.conf | 3 +- collectd/files/dbi.conf | 5 +- collectd/files/default.conf | 3 +- collectd/files/df.conf | 31 ++++++------- collectd/files/disk.conf | 7 ++- collectd/files/elasticsearch.conf | 28 +++++++----- collectd/files/ethstat.conf | 1 - collectd/files/exec.conf | 1 - collectd/files/interface.conf | 1 - collectd/files/java.conf | 1 - collectd/files/librato.conf | 4 +- collectd/files/logfile.conf | 1 - collectd/files/md.conf | 7 ++- collectd/files/memcached.conf | 1 - collectd/files/mysql.conf | 26 +++++------ collectd/files/network.conf | 56 ++++++----------------- collectd/files/nginx.conf | 1 - collectd/files/ntpd.conf | 1 - collectd/files/openldap.conf | 68 ++++++++++++++-------------- collectd/files/ping.conf | 9 ++-- collectd/files/postgresql.conf | 21 ++++----- collectd/files/powerdns.conf | 1 - collectd/files/processes.conf | 2 +- collectd/files/protocols.conf | 2 +- collectd/files/python.conf | 29 ++++++------ collectd/files/rabbitmq.conf | 12 +++-- collectd/files/redis.conf | 3 +- collectd/files/redis_info.conf | 18 ++++---- collectd/files/rrdtool.conf | 9 ++-- collectd/files/statsd.conf | 3 +- collectd/files/syslog.conf | 5 +- collectd/files/tail.conf | 21 ++++----- collectd/files/tcpconns.conf | 1 - collectd/files/unixsock.conf | 3 +- collectd/files/vmem.conf | 5 +- collectd/files/write_graphite.conf | 26 +++++------ collectd/files/write_prometheus.conf | 4 +- collectd/files/write_riemann.conf | 32 ++++++------- collectd/files/zookeeper.conf | 8 ++-- 43 files changed, 258 insertions(+), 327 deletions(-) diff --git a/collectd/files/apache.conf b/collectd/files/apache.conf index 861a378..6af7c8c 100644 --- a/collectd/files/apache.conf +++ b/collectd/files/apache.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,29 +8,28 @@ LoadPlugin apache - - + {%- for instance in collectd_settings.plugins.apache.instances %} - - 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 %} - + + 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 %} + {%- endfor %} diff --git a/collectd/files/bind.conf b/collectd/files/bind.conf index 1ccf72f..03f1ef5 100644 --- a/collectd/files/bind.conf +++ b/collectd/files/bind.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,42 +8,42 @@ LoadPlugin 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 }} + + 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 %} - - {%- 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 %} + + {%- 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 %} - + {%- if view.zones is defined %} + {% for zone in view.zones %} + Zone "{{ zone }}" {%- endfor %} + {%- endif %} + +{%- endfor %} {%- endif %} diff --git a/collectd/files/collectd.conf b/collectd/files/collectd.conf index 825e4b0..e616df3 100644 --- a/collectd/files/collectd.conf +++ b/collectd/files/collectd.conf @@ -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 # @@ -9,8 +8,6 @@ Hostname "{{ collectd_settings.Hostname }}" FQDNLookup {{ collectd_settings.FQDNLookup }} -#BaseDir "/var/lib/collectd" -#PluginDir "/usr/lib/collectd" {% for type in collectd_settings.TypesDB %} TypesDB "{{ type }}" @@ -18,10 +15,8 @@ TypesDB "{{ type }}" 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" diff --git a/collectd/files/curl_json.conf b/collectd/files/curl_json.conf index 97b692c..9ac2f3e 100644 --- a/collectd/files/curl_json.conf +++ b/collectd/files/curl_json.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,7 +8,7 @@ LoadPlugin curl_json - + {% for block, block_data in collectd_settings.plugins.curl_json.items() %} <{{ block }}> {%- if block_data.instance is defined %} diff --git a/collectd/files/curl_xml.conf b/collectd/files/curl_xml.conf index f4b9551..eb9e60b 100644 --- a/collectd/files/curl_xml.conf +++ b/collectd/files/curl_xml.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,7 +8,7 @@ LoadPlugin curl_xml - + {% for block, block_data in collectd_settings.plugins.curl_xml.items() %} <{{ block }}> {%- if block_data.host is defined %} diff --git a/collectd/files/dbi.conf b/collectd/files/dbi.conf index 547ccfc..1d48ddc 100644 --- a/collectd/files/dbi.conf +++ b/collectd/files/dbi.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,8 +8,8 @@ LoadPlugin dbi - -{%- for query in collectd_settings.plugins.dbi.queries %} + +{%- for query in collectd_settings.plugins.dbi.queries %} Statement "{{ query.statement }}" {%- for res in query.results %} diff --git a/collectd/files/default.conf b/collectd/files/default.conf index e87c831..26d3940 100644 --- a/collectd/files/default.conf +++ b/collectd/files/default.conf @@ -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 # @@ -7,7 +7,6 @@ # # Loaded by collectd.conf (Include {{ collectd_settings.plugindirconfig }}/*.conf) - {% for plugin in collectd_settings.plugins.default %} LoadPlugin {{ plugin }} {%- endfor %} diff --git a/collectd/files/df.conf b/collectd/files/df.conf index d2bdfdb..62a5e34 100644 --- a/collectd/files/df.conf +++ b/collectd/files/df.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -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 %} - + {%- 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 }}" diff --git a/collectd/files/disk.conf b/collectd/files/disk.conf index 28ba119..963ad80 100644 --- a/collectd/files/disk.conf +++ b/collectd/files/disk.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,9 +8,9 @@ LoadPlugin 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 }}" diff --git a/collectd/files/elasticsearch.conf b/collectd/files/elasticsearch.conf index 365e02e..9b45330 100644 --- a/collectd/files/elasticsearch.conf +++ b/collectd/files/elasticsearch.conf @@ -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 +# - Globals true + Globals true - ModulePath "{{ collectd_settings.moduledirconfig }}" - - Import "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 }}" - + ModulePath "{{ collectd_settings.moduledirconfig }}" + Import "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 }}" + diff --git a/collectd/files/ethstat.conf b/collectd/files/ethstat.conf index 54c6810..dda4686 100644 --- a/collectd/files/ethstat.conf +++ b/collectd/files/ethstat.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/exec.conf b/collectd/files/exec.conf index f551c8b..bd50bfb 100644 --- a/collectd/files/exec.conf +++ b/collectd/files/exec.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/interface.conf b/collectd/files/interface.conf index c1193a6..7684239 100644 --- a/collectd/files/interface.conf +++ b/collectd/files/interface.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/java.conf b/collectd/files/java.conf index 338cd97..2ccc0a9 100644 --- a/collectd/files/java.conf +++ b/collectd/files/java.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/librato.conf b/collectd/files/librato.conf index 4be3488..6f20348 100644 --- a/collectd/files/librato.conf +++ b/collectd/files/librato.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,8 +8,7 @@ LoadPlugin write_http - - + User "{{ collectd_settings.plugins.librato.user }}" Password "{{ collectd_settings.plugins.librato.token }}" diff --git a/collectd/files/logfile.conf b/collectd/files/logfile.conf index 4c6e199..e7a8fa7 100644 --- a/collectd/files/logfile.conf +++ b/collectd/files/logfile.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/md.conf b/collectd/files/md.conf index aae8eee..53f9fe5 100644 --- a/collectd/files/md.conf +++ b/collectd/files/md.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,9 +8,9 @@ LoadPlugin 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 }}" diff --git a/collectd/files/memcached.conf b/collectd/files/memcached.conf index 6076488..45b65cc 100644 --- a/collectd/files/memcached.conf +++ b/collectd/files/memcached.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/mysql.conf b/collectd/files/mysql.conf index 9296d67..52b0f7c 100644 --- a/collectd/files/mysql.conf +++ b/collectd/files/mysql.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,35 +8,34 @@ LoadPlugin mysql - - + {% for db in collectd_settings.plugins.mysql.databases %} - - Host "{{ db.host }}" + + Host "{{ db.host }}" {%- if db.port is defined and db.port %} - Port "{{ db.port }}" + Port "{{ db.port }}" {%- endif %} {%- if db.user is defined and db.user %} - User "{{ db.user }}" + User "{{ db.user }}" {%- endif %} {%- if db.pass is defined and db.pass %} - Password "{{ db.pass }}" + Password "{{ db.pass }}" {%- endif %} {%- if db.dbname is defined and db.dbname %} - Database "{{ db.dbname }}" + Database "{{ db.dbname }}" {%- endif %} {%- if db.socket is defined and db.socket %} - Socket "{{ db.socket }}" + Socket "{{ db.socket }}" {%- endif %} {%- if db.masterstats is defined and db.masterstats %} - MasterStats {{ db.masterstats|lower }} + MasterStats {{ db.masterstats|lower }} {%- endif %} {%- if db.slavestats is defined and db.slavestats %} - SlaveStats {{ db.slavestats|lower }} + SlaveStats {{ db.slavestats|lower }} {%- endif %} {%- if db.slavenotifications is defined and db.slavenotifications %} - SlaveNotifications {{ db.slavenotifications|lower }} + SlaveNotifications {{ db.slavenotifications|lower }} {%- endif %} - + {%- endfor %} diff --git a/collectd/files/network.conf b/collectd/files/network.conf index e1fccc4..1ef7f4d 100644 --- a/collectd/files/network.conf +++ b/collectd/files/network.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -10,45 +9,18 @@ LoadPlugin network -# # client setup: - <{{ collectd_settings.plugins.network.type | default('Server') }} "{{ collectd_settings.plugins.network.host }}" "{{ collectd_settings.plugins.network.port }}"> - {%- if collectd_settings.plugins.network.securitylevel is defined%} - SecurityLevel "{{ collectd_settings.plugins.network.securitylevel }}" - {%- endif %} - {%- if collectd_settings.plugins.network.username is defined and collectd_settings.plugins.network.username and collectd_settings.plugins.network.type == 'Server' %} - UserName "{{ collectd_settings.plugins.network.username }}" - {%- endif %} - {%- if collectd_settings.plugins.network.password is defined and collectd_settings.plugins.network.password and collectd_settings.plugins.network.type == 'Server' %} - Password "{{ collectd_settings.plugins.network.password }}" - {%- endif %} - {%- if collectd_settings.plugins.network.authfile is defined and collectd_settings.plugins.network.authfile and collectd_settings.plugins.network.type == 'Listen' %} - AuthFile "{{ collectd_settings.plugins.network.authfile }}" - {%- endif %} - -# -# SecurityLevel Encrypt -# Username "user" -# Password "secret" -# Interface "eth0" -# -# TimeToLive "128" -# -# # server setup: -# Listen "ff18::efc0:4a42" "25826" -# -# SecurityLevel Sign -# AuthFile "/etc/collectd/passwd" -# Interface "eth0" -# -# MaxPacketSize 1024 -# -# # proxy setup (client and server as above): -# Forward true -# -# # statistics about the network plugin itself -# ReportStats false -# -# # "garbage collection" -# CacheFlush 1800 + <{{ collectd_settings.plugins.network.type | default('Server') }} "{{ collectd_settings.plugins.network.host }}" "{{ collectd_settings.plugins.network.port }}"> + {%- if collectd_settings.plugins.network.securitylevel is defined%} + SecurityLevel "{{ collectd_settings.plugins.network.securitylevel }}" + {%- endif %} + {%- if collectd_settings.plugins.network.username is defined and collectd_settings.plugins.network.username and collectd_settings.plugins.network.type == 'Server' %} + UserName "{{ collectd_settings.plugins.network.username }}" + {%- endif %} + {%- if collectd_settings.plugins.network.password is defined and collectd_settings.plugins.network.password and collectd_settings.plugins.network.type == 'Server' %} + Password "{{ collectd_settings.plugins.network.password }}" + {%- endif %} + {%- if collectd_settings.plugins.network.authfile is defined and collectd_settings.plugins.network.authfile and collectd_settings.plugins.network.type == 'Listen' %} + AuthFile "{{ collectd_settings.plugins.network.authfile }}" + {%- endif %} + - diff --git a/collectd/files/nginx.conf b/collectd/files/nginx.conf index 3eebc2d..39d72db 100644 --- a/collectd/files/nginx.conf +++ b/collectd/files/nginx.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/ntpd.conf b/collectd/files/ntpd.conf index 888ace5..7bc38c5 100644 --- a/collectd/files/ntpd.conf +++ b/collectd/files/ntpd.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/openldap.conf b/collectd/files/openldap.conf index 91991eb..d30481b 100644 --- a/collectd/files/openldap.conf +++ b/collectd/files/openldap.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,40 +8,39 @@ LoadPlugin openldap - - + {%- for instance in collectd_settings.plugins.openldap.instances %} - - URL "{{ instance.url }}" - {%- if instance.binddn is defined %} - BindDN "{{ instance.binddn }}" - {%- endif %} - {%- if instance.password is defined %} - Password "{{ instance.password }}" - {%- endif %} - {%- if instance.starttls is defined %} - {%- if instance.starttls %} - StartTLS true - {%- else %} - StartTLS false - {% endif %} - {%- endif %} - {%- if instance.verifyhost is defined %} - {%- if instance.verifyhost %} - VerifyHost true - {%- else %} - VerifyHost false - {% endif %} - {%- endif %} - {%- if instance.cacert is defined %} - CACert "{{ instance.cacert }}" - {%- endif %} - {%- if instance.timeout is defined %} - Timeout "{{ instance.timeout }}" - {%- endif %} - {%- if instance.version is defined %} - Version "{{ instance.version }}" - {%- endif %} - + + URL "{{ instance.url }}" + {%- if instance.binddn is defined %} + BindDN "{{ instance.binddn }}" + {%- endif %} + {%- if instance.password is defined %} + Password "{{ instance.password }}" + {%- endif %} + {%- if instance.starttls is defined %} + {%- if instance.starttls %} + StartTLS true + {%- else %} + StartTLS false + {% endif %} + {%- endif %} + {%- if instance.verifyhost is defined %} + {%- if instance.verifyhost %} + VerifyHost true + {%- else %} + VerifyHost false + {% endif %} + {%- endif %} + {%- if instance.cacert is defined %} + CACert "{{ instance.cacert }}" + {%- endif %} + {%- if instance.timeout is defined %} + Timeout "{{ instance.timeout }}" + {%- endif %} + {%- if instance.version is defined %} + Version "{{ instance.version }}" + {%- endif %} + {%- endfor %} diff --git a/collectd/files/ping.conf b/collectd/files/ping.conf index 233814b..f6602b2 100644 --- a/collectd/files/ping.conf +++ b/collectd/files/ping.conf @@ -1,12 +1,9 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - {%- set hosts = collectd_settings.plugins.ping.hosts %} {%- set hfg = collectd_settings.plugins.ping.hosts_from_grains %} - -{% if hfg and salt['mine.get'](hfg.target, hfg.fun, hfg.expr_form) -%} -{% set hosts = hosts + salt['mine.get'](hfg.target, hfg.fun, hfg.expr_form).values() -%} -{% endif -%} - +{%- if hfg and salt['mine.get'](hfg.target, hfg.fun, hfg.expr_form) %} +{%- set hosts = hosts + salt['mine.get'](hfg.target, hfg.fun, hfg.expr_form).values() %} +{%- endif %} # # DO NOT EDIT # diff --git a/collectd/files/postgresql.conf b/collectd/files/postgresql.conf index db7a1e8..ca272a7 100644 --- a/collectd/files/postgresql.conf +++ b/collectd/files/postgresql.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,18 +8,14 @@ LoadPlugin postgresql - + {%- for db in collectd_settings.plugins.postgresql.databases %} - - Host "{{ db.host }}" - Port "{{ db.port }}" - User "{{ db.user }}" - Password "{{ db.pass }}" - Database "{{ db.name }}" - # SSLMode "prefer" - # KRBSrvName "kerberos_service_name" - - # Query magic - + + Host "{{ db.host }}" + Port "{{ db.port }}" + User "{{ db.user }}" + Password "{{ db.pass }}" + Database "{{ db.name }}" + {%- endfor %} diff --git a/collectd/files/powerdns.conf b/collectd/files/powerdns.conf index 60aed31..4a096e4 100644 --- a/collectd/files/powerdns.conf +++ b/collectd/files/powerdns.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # diff --git a/collectd/files/processes.conf b/collectd/files/processes.conf index 3ac8715..6082853 100644 --- a/collectd/files/processes.conf +++ b/collectd/files/processes.conf @@ -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 # diff --git a/collectd/files/protocols.conf b/collectd/files/protocols.conf index 0f26c70..15f2710 100644 --- a/collectd/files/protocols.conf +++ b/collectd/files/protocols.conf @@ -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 # diff --git a/collectd/files/python.conf b/collectd/files/python.conf index af3032d..4946fe7 100644 --- a/collectd/files/python.conf +++ b/collectd/files/python.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -7,25 +6,25 @@ # Modify the config that generates this file instead # - - Globals {{ collectd_settings.plugins.python.Globals | lower }} + + Globals {{ collectd_settings.plugins.python.Globals | lower }} - - ModulePath "{{ collectd_settings.moduledirconfig }}" - LogTraces {{ collectd_settings.plugins.python.LogTraces | lower }} - Interactive {{ collectd_settings.plugins.python.Interactive | lower }} + + ModulePath "{{ collectd_settings.moduledirconfig }}" + LogTraces {{ collectd_settings.plugins.python.LogTraces | lower }} + Interactive {{ collectd_settings.plugins.python.Interactive | lower }} {% if collectd_settings.plugins.python.get('modules', false) %} {%- for module, array in collectd_settings.plugins.python.modules.items() %} - Import "{{ module }}" - {%- if array['variables'] is defined %} - - {%- for key, value in array['variables'].items() | sort %} - {{ key }} {{ value }} - {%- endfor %} - - {%- endif %} + Import "{{ module }}" + {%- if array['variables'] is defined %} + + {%- for key, value in array['variables'].items() | sort %} + {{ key }} {{ value }} + {%- endfor %} + + {%- endif %} {%- endfor %} {% endif %} diff --git a/collectd/files/rabbitmq.conf b/collectd/files/rabbitmq.conf index c6c30a2..840f8a6 100644 --- a/collectd/files/rabbitmq.conf +++ b/collectd/files/rabbitmq.conf @@ -1,13 +1,19 @@ -{%- from "collectd/map.jinja" import collectd_settings with context -%} +{%- 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 +# # Configure the rabbitmq-collectd-plugin TypesDB "/usr/local/share/collectd-rabbitmq/types.db.custom" - + Globals true - + LogTraces true Interactive false Import "collectd_rabbitmq.collectd_plugin" diff --git a/collectd/files/redis.conf b/collectd/files/redis.conf index 5a133fb..186472f 100644 --- a/collectd/files/redis.conf +++ b/collectd/files/redis.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,7 +8,7 @@ LoadPlugin redis - + Host "localhost" Port "6379" diff --git a/collectd/files/redis_info.conf b/collectd/files/redis_info.conf index 31267c4..b23f7c5 100644 --- a/collectd/files/redis_info.conf +++ b/collectd/files/redis_info.conf @@ -1,21 +1,24 @@ {%- 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 +# -# Configure the redis_info-collectd-plugin - - + Globals true - + ModulePath "{{ collectd_settings.moduledirconfig }}" Import "redis_info" Host {{ collectd_settings.plugins.redis_info.host }} Port {{ collectd_settings.plugins.redis_info.port }} - # Un-comment to use AUTH - #Auth Verbose {{ collectd_settings.plugins.redis_info.verbose }} + # Catch Redis metrics (prefix with Redis_) Redis_uptime_in_seconds "gauge" Redis_uptime_in_days "gauge" @@ -33,8 +36,5 @@ Redis_total_commands_processed "counter" Redis_keyspace_hits "derive" Redis_keyspace_misses "derive" - #Redis_master_repl_offset "gauge" - #Redis_master_last_io_seconds_ago "gauge" - #Redis_slave_repl_offset "gauge" diff --git a/collectd/files/rrdtool.conf b/collectd/files/rrdtool.conf index 22f1bd6..f67cc71 100644 --- a/collectd/files/rrdtool.conf +++ b/collectd/files/rrdtool.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,8 +8,8 @@ LoadPlugin rrdtool - - DataDir "{{ collectd_settings.plugins.rrdtool.datadir }}" - CacheFlush {{ collectd_settings.plugins.rrdtool.cacheflush }} - WritesPerSecond {{ collectd_settings.plugins.rrdtool.writespersecond }} + + DataDir "{{ collectd_settings.plugins.rrdtool.datadir }}" + CacheFlush {{ collectd_settings.plugins.rrdtool.cacheflush }} + WritesPerSecond {{ collectd_settings.plugins.rrdtool.writespersecond }} diff --git a/collectd/files/statsd.conf b/collectd/files/statsd.conf index d5b56fd..a489d0f 100644 --- a/collectd/files/statsd.conf +++ b/collectd/files/statsd.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,7 +8,7 @@ LoadPlugin statsd - + Host "{{ collectd_settings.plugins.statsd.host }}" Port {{ collectd_settings.plugins.statsd.port }} diff --git a/collectd/files/syslog.conf b/collectd/files/syslog.conf index 47b1e0e..34bade8 100644 --- a/collectd/files/syslog.conf +++ b/collectd/files/syslog.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,6 +8,6 @@ LoadPlugin syslog - - LogLevel {{ collectd_settings.plugins.syslog.loglevel }} + + LogLevel {{ collectd_settings.plugins.syslog.loglevel }} diff --git a/collectd/files/tail.conf b/collectd/files/tail.conf index 7f86839..946fb21 100644 --- a/collectd/files/tail.conf +++ b/collectd/files/tail.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -10,19 +9,17 @@ LoadPlugin tail - {%- for tail in collectd_settings.plugins.tail %} - - Instance "{{ tail.instance }}" + + Instance "{{ tail.instance }}" {%- for match in tail.match %} - - Regex "{{ match.regex }}" - DSType "{{ match.dstype }}" - Type "{{ match.type }}" - Instance "{{ match.instance }}" - + + Regex "{{ match.regex }}" + DSType "{{ match.dstype }}" + Type "{{ match.type }}" + Instance "{{ match.instance }}" + {%- endfor %} - + {%- endfor %} - diff --git a/collectd/files/tcpconns.conf b/collectd/files/tcpconns.conf index 12ea44c..c08be69 100644 --- a/collectd/files/tcpconns.conf +++ b/collectd/files/tcpconns.conf @@ -18,4 +18,3 @@ LoadPlugin tcpconns RemotePort "{{ remote_port }}" {%- endfor %} - diff --git a/collectd/files/unixsock.conf b/collectd/files/unixsock.conf index d8c7993..82d3b3b 100644 --- a/collectd/files/unixsock.conf +++ b/collectd/files/unixsock.conf @@ -1,5 +1,4 @@ {%- from "collectd/map.jinja" import collectd_settings with context %} - # # DO NOT EDIT # @@ -9,7 +8,7 @@ LoadPlugin unixsock - + SocketFile "{{ collectd_settings.plugins.unixsock.socket_file }}" SocketGroup "{{ collectd_settings.plugins.unixsock.socket_group }}" SocketPerms "{{ collectd_settings.plugins.unixsock.socket_perms }}" diff --git a/collectd/files/vmem.conf b/collectd/files/vmem.conf index 88490f7..6e7ee6a 100644 --- a/collectd/files/vmem.conf +++ b/collectd/files/vmem.conf @@ -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 # @@ -10,5 +9,5 @@ LoadPlugin vmem - Verbose {{ collectd_settings.plugins.vmem.verbose | lower }} + Verbose {{ collectd_settings.plugins.vmem.verbose | lower }} diff --git a/collectd/files/write_graphite.conf b/collectd/files/write_graphite.conf index 96d79dc..224816b 100644 --- a/collectd/files/write_graphite.conf +++ b/collectd/files/write_graphite.conf @@ -8,29 +8,29 @@ LoadPlugin write_graphite - - - Host "{{ collectd_settings.plugins.write_graphite.host }}" - Port "{{ collectd_settings.plugins.write_graphite.port }}" + + + Host "{{ collectd_settings.plugins.write_graphite.host }}" + Port "{{ collectd_settings.plugins.write_graphite.port }}" {%- if collectd_settings.plugins.write_graphite.protocol is defined %} - Protocol "{{ collectd_settings.plugins.write_graphite.protocol|lower }}" + Protocol "{{ collectd_settings.plugins.write_graphite.protocol|lower }}" {%- endif %} - Prefix "{{ collectd_settings.plugins.write_graphite.prefix }}" - Postfix "{{ collectd_settings.plugins.write_graphite.postfix }}" + Prefix "{{ collectd_settings.plugins.write_graphite.prefix }}" + Postfix "{{ collectd_settings.plugins.write_graphite.postfix }}" {%- if collectd_settings.plugins.write_graphite.escapecharacter is defined and collectd_settings.plugins.write_graphite.escapecharacter %} - EscapeCharacter "{{ collectd_settings.plugins.write_graphite.escapecharacter }}" + EscapeCharacter "{{ collectd_settings.plugins.write_graphite.escapecharacter }}" {%- endif %} {%- if collectd_settings.plugins.write_graphite.logsenderrors is defined and collectd_settings.plugins.write_graphite.logsenderrors %} - LogSendErrors {{ collectd_settings.plugins.write_graphite.logsenderrors|lower }} + LogSendErrors {{ collectd_settings.plugins.write_graphite.logsenderrors|lower }} {%- endif %} {%- if collectd_settings.plugins.write_graphite.separateinstances is defined and collectd_settings.plugins.write_graphite.separateinstances %} - SeparateInstances {{ collectd_settings.plugins.write_graphite.separateinstances|lower }} + SeparateInstances {{ collectd_settings.plugins.write_graphite.separateinstances|lower }} {%- endif %} {%- if collectd_settings.plugins.write_graphite.storerates is defined %} - StoreRates {{ collectd_settings.plugins.write_graphite.storerates|lower }} + StoreRates {{ collectd_settings.plugins.write_graphite.storerates|lower }} {%- endif %} {%- if collectd_settings.plugins.write_graphite.alwaysappendds is defined and collectd_settings.plugins.write_graphite.alwaysappendds %} - AlwaysAppendDS {{ collectd_settings.plugins.write_graphite.alwaysappendds|lower }} + AlwaysAppendDS {{ collectd_settings.plugins.write_graphite.alwaysappendds|lower }} {%- endif %} - + diff --git a/collectd/files/write_prometheus.conf b/collectd/files/write_prometheus.conf index b8aa053..6b35b12 100644 --- a/collectd/files/write_prometheus.conf +++ b/collectd/files/write_prometheus.conf @@ -8,6 +8,6 @@ LoadPlugin write_prometheus - - Port "{{ collectd_settings.plugins.write_prometheus.port }}" + + Port "{{ collectd_settings.plugins.write_prometheus.port }}" diff --git a/collectd/files/write_riemann.conf b/collectd/files/write_riemann.conf index c1e67a1..fb6d566 100644 --- a/collectd/files/write_riemann.conf +++ b/collectd/files/write_riemann.conf @@ -9,34 +9,34 @@ LoadPlugin write_riemann - - Host "{{ collectd_settings.plugins.write_riemann.host }}" - Port "{{ collectd_settings.plugins.write_riemann.port }}" - Protocol {{ collectd_settings.plugins.write_riemann.protocol|upper }} - Batch {{ collectd_settings.plugins.write_riemann.batch|lower }} + + Host "{{ collectd_settings.plugins.write_riemann.host }}" + Port "{{ collectd_settings.plugins.write_riemann.port }}" + Protocol {{ collectd_settings.plugins.write_riemann.protocol|upper }} + Batch {{ collectd_settings.plugins.write_riemann.batch|lower }} {%- if collectd_settings.plugins.write_riemann.batchmaxsize is defined %} - BatchMaxSize {{ collectd_settings.plugins.write_riemann.baxmaxsize }} + BatchMaxSize {{ collectd_settings.plugins.write_riemann.baxmaxsize }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.storerates is defined and collectd_settings.plugins.write_riemann.storerates %} - StoreRates {{ collectd_settings.plugins.write_riemann.storerates|lower }} + StoreRates {{ collectd_settings.plugins.write_riemann.storerates|lower }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.alwaysappendds is defined and collectd_settings.plugins.write_riemann.alwaysappendds %} - AlwaysAppendDS {{ collectd_settings.plugins.write_riemann.alwaysappendds|lower }} + AlwaysAppendDS {{ collectd_settings.plugins.write_riemann.alwaysappendds|lower }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.ttlfactor is defined %} - TTLFactor {{ collectd_settings.plugins.write_riemann.ttlfactor }} + TTLFactor {{ collectd_settings.plugins.write_riemann.ttlfactor }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.notifications is defined %} - Notifications {{ collectd_settings.plugins.write_riemann.notifications|lower }} + Notifications {{ collectd_settings.plugins.write_riemann.notifications|lower }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.checkthresholds is defined %} - CheckThresholds {{ collectd_settings.plugins.write_riemann.checkthresholds|lower }} + CheckThresholds {{ collectd_settings.plugins.write_riemann.checkthresholds|lower }} {%- endif %} {%- if collectd_settings.plugins.write_riemann.eventserviceprefix is defined %} - EventServicePrefix {{ collectd_settings.plugins.write_riemann.eventserviceprefix }} + EventServicePrefix {{ collectd_settings.plugins.write_riemann.eventserviceprefix }} +{%- endif %} + +{%- if collectd_settings.plugins.write_riemann.tag is defined %} + Tag "{{ collectd_settings.plugins.write_riemann.tag }}" {%- endif %} - - {%- if collectd_settings.plugins.write_riemann.tag is defined %} - Tag "{{ collectd_settings.plugins.write_riemann.tag }}" - {%- endif %} diff --git a/collectd/files/zookeeper.conf b/collectd/files/zookeeper.conf index ea5ac64..8eac958 100644 --- a/collectd/files/zookeeper.conf +++ b/collectd/files/zookeeper.conf @@ -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 # @@ -10,7 +9,6 @@ LoadPlugin zookeeper - Host {{ collectd_settings.plugins.zookeeper.host }} - Port {{ collectd_settings.plugins.zookeeper.port }} + Host {{ collectd_settings.plugins.zookeeper.host }} + Port {{ collectd_settings.plugins.zookeeper.port }} -