blob: e7fa0cbadcd037dad1d4b894596f535a4210f931 [file] [log] [blame]
{%- from "collectd/map.jinja" import client with context %}
{%- set service_grains = {'collectd': {'local_plugin': {}}} %}
{%- for service_name, service in pillar.items() %}
{%- if service.get('_support', {}).get('collectd', {}).get('enabled', False) %}
{%- set grains_fragment_file = service_name+'/meta/collectd.yml' %}
{%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
{%- set grains_yaml = load_grains_file()|load_yaml %}
{%- do service_grains.collectd.local_plugin.update(grains_yaml.get('local_plugin', {})) %}
{%- endif %}
{%- endfor %}
doc:
name: collectd
description: Collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files.
role:
client:
name: client
param:
{%- for backend_name, backend in client.backend.iteritems() %}
backend_{{ backend_name }}:
name: {{ backend_name }} writer
value: {{ backend.host }}:{{ backend.port }}
{%- endfor %}
plugins:
value: {% for plugin_name, plugin in service_grains.collectd.local_plugin.iteritems() %} {{ plugin_name }}{% endfor %}