diff --git a/napalm_ios/ios.py b/napalm_ios/ios.py index c84f9c5..2d312f2 100644 --- a/napalm_ios/ios.py +++ b/napalm_ios/ios.py @@ -1261,16 +1261,13 @@ def get_interfaces_counters(self): counters[interface]['tx_discards'] = -1 for line in sh_int_sum_cmd_out.splitlines(): if interface in line: - # ' Interface IHQ IQD OHQ OQD' +\ - # ' RXBS RXPS TXBS TXPS TRTL' - # '---------------------------------------------------------------' +\ - # '--------------------------------------------------' - # ' FastEthernet0 0 0 0 0' +\ - # ' 0 0 0 0 0' - regex = r"\b" + interface +\ - r"\b\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)" +\ - r"\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)" + \ - r"\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)" + # Line is tabular output with columns + # Interface IHQ IQD OHQ OQD RXBS RXPS TXBS TXPS TRTL + # where columns (excluding interface) are integers + regex = r"\b" + interface + \ + r"\b\s+(\d+)\s+(?P\d+)\s+(\d+)" + \ + r"\s+(?P\d+)\s+(\d+)\s+(\d+)" + \ + r"\s+(\d+)\s+(\d+)\s+(\d+)" match = re.search(regex, line) if match: counters[interface]['rx_discards'] = int(match.group("IQD"))