r/collectd: Better control over enabled plugins

Instead of a simple list of disabled plugins, hosts and host groups can
now control whether plugins are enabled or disabled using the
`collectd_plugins` map.  The map keys are plugin names, and the values
are booleans indicating if the plugin is enabled.

Using this mechanism, some plugins can be disabled by default (e.g. the
*md* plugin), and enabling them per host or per host group is simpler.
btop
Dustin 2022-07-21 12:18:43 -05:00
parent c7ca8e5b15
commit 29a6a0540f
2 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,10 @@ collectd_load_network_plugin: false
collectd_network_servers: [] collectd_network_servers: []
collectd_network_listen: [] collectd_network_listen: []
collectd_disable_plugins: [] collectd_plugins: {}
collectd_plugins_defaults:
md: false
collectd_df: {} collectd_df: {}

View File

@ -90,9 +90,9 @@ LoadPlugin syslog
############################################################################## ##############################################################################
{% macro load_plugin(name) %} {% macro load_plugin(name) %}
{% if name in collectd_disable_plugins %} {% if (collectd_plugins_defaults | combine(collectd_plugins)).get(name, true) | bool is false %}
#LoadPlugin {{ name }} #LoadPlugin {{ name }}
{% else %} {%- else %}
LoadPlugin {{ name }} LoadPlugin {{ name }}
{%- endif -%} {%- endif -%}
{% endmacro %} {% endmacro %}