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.
This commit is contained in:
@@ -3,7 +3,10 @@ collectd_load_network_plugin: false
|
||||
collectd_network_servers: []
|
||||
collectd_network_listen: []
|
||||
|
||||
collectd_disable_plugins: []
|
||||
collectd_plugins: {}
|
||||
|
||||
collectd_plugins_defaults:
|
||||
md: false
|
||||
|
||||
collectd_df: {}
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ LoadPlugin syslog
|
||||
##############################################################################
|
||||
|
||||
{% 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 }}
|
||||
{% else %}
|
||||
{%- else %}
|
||||
LoadPlugin {{ name }}
|
||||
{%- endif -%}
|
||||
{% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user