Use netlink collectd plugin instead of interface
This patch replaces the "interface" collectd plugin by the "netlink" one. The
"netlink" plugin provides the same metrics as "interface" but plus other
metrics such as the number of dropped packets.
diff --git a/_modules/netlink.py b/_modules/netlink.py
new file mode 100644
index 0000000..9e6df55
--- /dev/null
+++ b/_modules/netlink.py
@@ -0,0 +1,17 @@
+# -*- 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())