diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index 22bc566b6..81e8e9af8 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -2697,18 +2697,26 @@ def process_mac_fields(vlan, mac, mac_type, interface): def get_probes_config(self): probes = {} - probes_regex = ( - r"ip\s+sla\s+(?P\d+)\n" - r"\s+(?P\S+)\s+(?P.*\n).*" - r"\s+tag\s+(?P\S+)\n.*" - r"\s+history\s+buckets-kept\s+(?P\d+)\n.*" - r"\s+frequency\s+(?P\d+)$" - ) + + probes_regex = '''ip\s+sla\s+(?P\d+)\n''' + probes_regex += '''\s+(?P\S+)\s+(?P.*)\n''' + probes_regex += '''\s+tag\s+(?P[\S ]+)\n''' + probes_regex += '''(\s+.*\n)*''' + probes_regex += '''(''' + probes_regex += '''(\s+frequency\s+(?P\d+)\n''' + probes_regex += '''(\s+.*\n)*''' + probes_regex += '''\s+history\s+buckets-kept\s+(?P\d+))''' + probes_regex += '''|''' + probes_regex += '''(\s+history\s+buckets-kept\s+(?P\d+)\n''' + probes_regex += '''(\s+.*\n)*''' + probes_regex += '''\s+frequency\s+(?P\d+))''' + probes_regex += ''')''' + probe_args = { "icmp-echo": r"^(?P\S+)\s+source-(?:ip|interface)\s+(?P\S+)$" } probe_type_map = {"icmp-echo": "icmp-ping"} - command = "show run | include ip sla [0-9]" + command = "show run | section ip sla [0-9]" output = self._send_command(command) for match in re.finditer(probes_regex, output, re.M): probe = match.groupdict() @@ -2724,8 +2732,8 @@ def get_probes_config(self): "probe_type": probe_type_map[probe["probe_type"]], "target": probe_data["target"], "source": probe_data["source"], - "probe_count": int(probe["probe_count"]), - "test_interval": int(probe["interval"]), + "probe_count": int(probe["probe_count0"] or probe["probe_count1"]), + "test_interval": int(probe["interval0"] or probe["interval1"]), } } diff --git a/test/ios/mocked_data/test_get_probes_config/normal/show_run___include_ip_sla__0_9_.txt b/test/ios/mocked_data/test_get_probes_config/normal/show_run___section_ip_sla__0_9_.txt similarity index 100% rename from test/ios/mocked_data/test_get_probes_config/normal/show_run___include_ip_sla__0_9_.txt rename to test/ios/mocked_data/test_get_probes_config/normal/show_run___section_ip_sla__0_9_.txt