diff --git a/templates/index b/templates/index index 6faf62273e..5131458359 100644 --- a/templates/index +++ b/templates/index @@ -233,6 +233,8 @@ juniper_junos_show_isis_adjacency.template, .*, juniper_junos, sh[[ow]] is[[is]] juniper_junos_show_ospf_neighbor.template, .*, juniper_junos, sh[[ow]] ospf n[[eighbor]] juniper_junos_show_interfaces.template, .*, juniper_junos, sh[[ow]] inte[[rfaces]] +juniper_screenos_get_route.template, .*, juniper_screenos, get route + paloalto_panos_show_running_security-policy.template, .*, paloalto_panos, sh[[ow]] runn[[ing]] security[[-policy]] paloalto_panos_show_high-availability_all.template, .*, paloalto_panos, sh[[ow]] high[[-availability]] all paloalto_panos_show_interface_hardware.template, .*, paloalto_panos, sh[[ow]] int[[erface]] hard[[ware]] diff --git a/templates/juniper_screenos_get_route.template b/templates/juniper_screenos_get_route.template new file mode 100644 index 0000000000..6d1f363d62 --- /dev/null +++ b/templates/juniper_screenos_get_route.template @@ -0,0 +1,28 @@ +Value Filldown VR (\S+) +Value BEST (\S+) +Value ID (\d+) +Value Required PREFIX (\S+) +Value OUTINTERFACE (\S+) +Value NEXTHOP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) +Value PROTOCOL (\S+) +Value PREF (\d+) +Value METRIC (\d+) +Value VSYS (\S+) + +Start + # Match the VR + ^IPv\d\s+Dest-Routes\s+for\s+<${VR}> + # Match route line + ^${BEST}\s+${ID}\s+${PREFIX}\s+${OUTINTERFACE}\s+${NEXTHOP}\s+${PROTOCOL}\s+${PREF}\s+${METRIC}\s+${VSYS} -> Record + # Match table separator + ^-+\s*$$ + # Match route type keys + ^\S+:\s+ + # Match lines that are just space + ^\s+$$ + # Match table header + ^\s+ID\s+IP-Prefix\s+Interface\s+Gateway\s+P\s+Pref\s+Mtr\s+Vsys\s*$$ + # Error out if line does not match any expressions + ^.+ -> Error "Line not found" + +EOF diff --git a/tests/juniper_screenos/get_route/juniper_screenos_get_route.parsed b/tests/juniper_screenos/get_route/juniper_screenos_get_route.parsed new file mode 100644 index 0000000000..b470ef9c77 --- /dev/null +++ b/tests/juniper_screenos/get_route/juniper_screenos_get_route.parsed @@ -0,0 +1,46 @@ +--- +parsed_sample: + +- vr: 'trust-vr' + best: '*' + id: '4' + prefix: '1.1.1.2/32' + outinterface: 'eth0/1' + nexthop: '0.0.0.0' + protocol: 'H' + pref: '0' + metric: '0' + vsys: 'Root' + +- vr: 'trust-vr' + best: '*' + id: '2' + prefix: '192.168.1.1/32' + outinterface: 'eth0/0' + nexthop: '0.0.0.0' + protocol: 'H' + pref: '0' + metric: '0' + vsys: 'Root' + +- vr: 'trust-vr' + best: '*' + id: '1' + prefix: '192.168.1.0/24' + outinterface: 'eth0/0' + nexthop: '0.0.0.0' + protocol: 'C' + pref: '0' + metric: '0' + vsys: 'Root' + +- vr: 'trust-vr' + best: '*' + id: '3' + prefix: '1.1.1.0/24' + outinterface: 'eth0/1' + nexthop: '0.0.0.0' + protocol: 'C' + pref: '0' + metric: '0' + vsys: 'Root' diff --git a/tests/juniper_screenos/get_route/juniper_screenos_get_route.raw b/tests/juniper_screenos/get_route/juniper_screenos_get_route.raw new file mode 100644 index 0000000000..598c60128d --- /dev/null +++ b/tests/juniper_screenos/get_route/juniper_screenos_get_route.raw @@ -0,0 +1,15 @@ +IPv4 Dest-Routes for (0 entries) +---------------------------------------------------------------------- +H: Host C: Connected S: Static A: Auto-Exported +I: Imported R: RIP P: Permanent D: Auto-Discovered +iB: IBGP eB: EBGP O: OSPF E1: OSPF external type 1 +E2: OSPF external type 2 + +IPv4 Dest-Routes for (4 entries) +---------------------------------------------------------------------- + ID IP-Prefix Interface Gateway P Pref Mtr Vsys +---------------------------------------------------------------------- +* 4 1.1.1.2/32 eth0/1 0.0.0.0 H 0 0 Root +* 2 192.168.1.1/32 eth0/0 0.0.0.0 H 0 0 Root +* 1 192.168.1.0/24 eth0/0 0.0.0.0 C 0 0 Root +* 3 1.1.1.0/24 eth0/1 0.0.0.0 C 0 0 Root