network/salt/collectd/collectd.conf

57 lines
1.2 KiB
Plaintext

Hostname "{{ salt['grains.get']('id') }}"
FQDNLookup false
Interval 10
LoadPlugin logfile
<Plugin logfile>
LogLevel info
File STDOUT
</Plugin>
{%- for plugin, conf in pillar['collectd'].items() %}
{%- if plugin == 'network' and conf == 'client' %}
LoadPlugin network
<Plugin network>
Server "{{ pillar['hosts-inet6']['dn42']['serv']['stats'] }}" "25826"
</Plugin>
{%- elif plugin == 'network' and conf == 'server' %}
LoadPlugin network
<Plugin network>
Listen "::" "25826"
Forward true
Server "{{ pillar['hosts-inet6']['dn42']['serv']['spaceapi'] }}" "25826"
Server "{{ pillar['hosts-inet6']['dn42']['serv']['grafana'] }}" "25826"
</Plugin>
{%- elif plugin == 'ping' %}
LoadPlugin ping
<Plugin ping>
{%- for host in conf %}
Host "{{ host }}"
{%- endfor %}
Interval 10
</Plugin>
{%- elif plugin == 'dhcpcount' and conf %}
LoadPlugin exec
<Plugin exec>
Exec "nobody" "/usr/bin/dhcpcount.rb"
</Plugin>
{%- elif conf is mapping %}
LoadPlugin {{ plugin }}
<Plugin {{ plugin }}>
{%- for k, v in conf.items() %}
{{ k }} "{{ v }}"
{%- endfor %}
</Plugin>
{%- else %}
LoadPlugin {{ plugin }}
{%- endif %}
{%- endfor %}