Use netlink collectd plugin instead of interfacetags/2016.12
# -*- coding: utf-8 -*- | |||||
import re | |||||
_alphanum_re = re.compile(r'^[a-z0-9]+$') | |||||
_lo_re = re.compile(r'^lo$') | |||||
def _filter(interface): | |||||
return _alphanum_re.match(interface) and not _lo_re.match(interface) | |||||
def ls(): | |||||
""" | |||||
Provide a list of network interfaces. | |||||
""" | |||||
return filter(_filter, __salt__['grains.get']('ip_interfaces', {}).keys()) |
<LoadPlugin netlink> | |||||
Globals false | |||||
</LoadPlugin> | |||||
<Plugin netlink> | |||||
{%- for interface_name in plugin.get('interfaces', []) %} | |||||
VerboseInterface "{{ interface_name }}" | |||||
{%- endfor %} | |||||
IgnoreSelected {{ plugin.get('ignore_selected', False)|lower }} | |||||
</Plugin> |
'doc_validity_pkgs': ['python-yaml'], | 'doc_validity_pkgs': ['python-yaml'], | ||||
}, | }, | ||||
'Debian': { | 'Debian': { | ||||
'pkgs': ['python-apt','vim-nox', 'apt-transport-https'], | |||||
'pkgs': ['python-apt','vim-nox', 'apt-transport-https', 'libmnl0'], | |||||
'utc': true, | 'utc': true, | ||||
'user': {}, | 'user': {}, | ||||
'group': {}, | 'group': {}, |
local_plugin: | local_plugin: | ||||
linux_network_interface: | |||||
plugin: interface | |||||
linux_network_netlink: | |||||
plugin: netlink | |||||
template: linux/files/collectd_netlink.conf | |||||
ignore_selected: false | |||||
interfaces: | |||||
{%- for interface_name in salt['netlink.ls']() %} | |||||
- {{ interface_name }} | |||||
{%- endfor %} | |||||
linux_system_cpu: | linux_system_cpu: | ||||
plugin: cpu | plugin: cpu | ||||
linux_system_entropy: | linux_system_entropy: |