diff --git a/checks.d/network.py b/checks.d/network.py index 26ef7242d1..f5b7b3033e 100644 --- a/checks.d/network.py +++ b/checks.d/network.py @@ -82,7 +82,7 @@ def check(self, instance): self._check_solaris(instance) def _submit_devicemetrics(self, iface, vals_by_metric): - if self._exclude_iface_re and self._exclude_iface_re.match(iface): + if iface in self._excluded_ifaces or (self._exclude_iface_re and self._exclude_iface_re.match(iface)): # Skip this network interface. return False @@ -98,27 +98,12 @@ def _submit_devicemetrics(self, iface, vals_by_metric): assert m in vals_by_metric assert len(vals_by_metric) == len(expected_metrics) - # For reasons i don't understand only these metrics are skipped if a - # particular interface is in the `excluded_interfaces` config list. - # Not sure why the others aren't included. Until I understand why, I'm - # going to keep the same behaviour. - exclude_iface_metrics = [ - 'packets_in.count', - 'packets_in.error', - 'packets_out.count', - 'packets_out.error', - ] - count = 0 for metric, val in vals_by_metric.iteritems(): - if iface in self._excluded_ifaces and metric in exclude_iface_metrics: - # skip it! - continue self.rate('system.net.%s' % metric, val, device_name=iface) count += 1 self.log.debug("tracked %s network metrics for interface %s" % (count, iface)) - def _parse_value(self, v): if v == "-": return 0