Skip to content

Commit

Permalink
New template: alcatel_sros_show_router_interface.textfsm (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ndzdatm0ld authored Mar 17, 2021
1 parent bde563b commit f5b2d86
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ntc_templates/templates/alcatel_sros_show_router_interface.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Value Required INTERFACE (\S+)
Value Required ADMIN_STATE (Up|Down)
Value Required OPER_STATE_V4 (Up|Down)
Value Required OPER_STATE_V6 (Up|Down)
Value Required MODE (\S+)
Value Required PORT_SAP_ID (\S+)
Value List ADDRESS (\S+)
Value List PFX_STATE (\S+)

Start
^=+
^Interface\s+Table
^Interface-Name\s+Adm\s+Opr\(v4\/v6\)\s+Mode\s+Port/SapId\s*$$ -> Interface
^\s*$$
^. -> Error

Interface
^\s+IP-Address\s+PfxState
^-+
^.*?\s+(Up|Down) -> Continue.Record
^${INTERFACE}\s+${ADMIN_STATE}\s+${OPER_STATE_V4}\/${OPER_STATE_V6}\s+${MODE}\s+${PORT_SAP_ID}
^\s+${ADDRESS}\s+${PFX_STATE}
^Interfaces -> Done
^=+
^\s*$$
^. -> Error

Done
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ alcatel_sros_show_router_ldp_interface.textfsm, .*, alcatel_sros, sh[[ow]] route
alcatel_sros_show_router_pim_interface.textfsm, .*, alcatel_sros, sh[[ow]] router pim int[[erface]]
alcatel_sros_show_service_sap-using.textfsm, .*, alcatel_sros, sh[[ow]] service sap-u[[sing]]
alcatel_sros_show_service_sdp-using.textfsm, .*, alcatel_sros, sh[[ow]] service sdp-using
alcatel_sros_show_router_interface.textfsm, .*, alcatel_sros, sh[[ow]] router (\d+ int[[erface]]|int[[erface]])
alcatel_sros_show_router_mpls_lsp.textfsm, .*, alcatel_sros, sh[[ow]] router mpls lsp
alcatel_sros_show_service_id_base.textfsm, .*, alcatel_sros, sh[[ow]] serv[[ice]] id ba[[se]]
alcatel_sros_show_service_sdp.textfsm, .*, alcatel_sros, sh[[ow]] service sdp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
===============================================================================
Interface Table (Router: Base)
===============================================================================
Interface-Name Adm Opr(v4/v6) Mode Port/SapId
IP-Address PfxState
-------------------------------------------------------------------------------
L3-Telecom-IXR01-1 Up Down/Up IES lag-21:300
2001:4888:2062:357a:645:400:0:2/64 PREFERRED
fe80::645:400:0:2/64 PREFERRED
L3-Telecom-IXR02-1 Up Down/Up IES lag-22:300
2001:4888:2062:3591:645:400:0:2/64 PREFERRED
fe80::645:400:0:2/64 PREFERRED
TO_EDGE_IXR01 Up Down/Down Network n/a
192.168.28.1/24 n/a
192.168.47.1/24 n/a
system Up Up/Up Network system
10.115.43.64/32 n/a
2001:4888:2062:3000:645:400:0:1a0/128 PREFERRED
to-7750-02 Up Up/Up Network 1/1/c4/1:2415
172.25.214.121/31 n/a
2001:4888:206a:335c:645:400:0:1/64 PREFERRED
fe80::c9:ffff:fe00:0/64 PREFERRED
to-BTS0415-7750-H1 Up Down/Down Network lag-11:4094
172.25.198.123/31 n/a
2001:4888:206a:335f:645:400:0:1/64 INACCESSIBLE
fe80::c9:ffff:fe00:14b/64 INACCESSIBLE
-------------------------------------------------------------------------------
Interfaces : 6
===============================================================================
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
parsed_sample:
- address:
- "2001:4888:2062:357a:645:400:0:2/64"
- "fe80::645:400:0:2/64"
admin_state: "Up"
interface: "L3-Telecom-IXR01-1"
mode: "IES"
oper_state_v4: "Down"
oper_state_v6: "Up"
pfx_state:
- "PREFERRED"
- "PREFERRED"
port_sap_id: "lag-21:300"
- address:
- "2001:4888:2062:3591:645:400:0:2/64"
- "fe80::645:400:0:2/64"
admin_state: "Up"
interface: "L3-Telecom-IXR02-1"
mode: "IES"
oper_state_v4: "Down"
oper_state_v6: "Up"
pfx_state:
- "PREFERRED"
- "PREFERRED"
port_sap_id: "lag-22:300"
- address:
- "192.168.28.1/24"
- "192.168.47.1/24"
admin_state: "Up"
interface: "TO_EDGE_IXR01"
mode: "Network"
oper_state_v4: "Down"
oper_state_v6: "Down"
pfx_state:
- "n/a"
- "n/a"
port_sap_id: "n/a"
- address:
- "10.115.43.64/32"
- "2001:4888:2062:3000:645:400:0:1a0/128"
admin_state: "Up"
interface: "system"
mode: "Network"
oper_state_v4: "Up"
oper_state_v6: "Up"
pfx_state:
- "n/a"
- "PREFERRED"
port_sap_id: "system"
- address:
- "172.25.214.121/31"
- "2001:4888:206a:335c:645:400:0:1/64"
- "fe80::c9:ffff:fe00:0/64"
admin_state: "Up"
interface: "to-7750-02"
mode: "Network"
oper_state_v4: "Up"
oper_state_v6: "Up"
pfx_state:
- "n/a"
- "PREFERRED"
- "PREFERRED"
port_sap_id: "1/1/c4/1:2415"
- address:
- "172.25.198.123/31"
- "2001:4888:206a:335f:645:400:0:1/64"
- "fe80::c9:ffff:fe00:14b/64"
admin_state: "Up"
interface: "to-BTS0415-7750-H1"
mode: "Network"
oper_state_v4: "Down"
oper_state_v6: "Down"
pfx_state:
- "n/a"
- "INACCESSIBLE"
- "INACCESSIBLE"
port_sap_id: "lag-11:4094"

5 comments on commit f5b2d86

@Kani999
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template does not work, if the Interface has a space in the name

@jvanderaa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it something like GigabitEthernet 1/0/1 that are in the name?

@Kani999
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jvanderaa

  • Version
# show version
TiMOS-C-16.0.R17 cpm/hops64 Nokia 7750 SR Copyright (c) 2000-2020 Nokia.
All rights reserved. All use subject to applicable license agreements.
  • Output of command
===============================================================================
Interface Table (Router: Base)
===============================================================================
Interface-Name                   Adm       Opr(v4/v6)  Mode    Port/SapId
   IP-Address                                                  PfxState
-------------------------------------------------------------------------------
Test                             Up        Down/Down   Network 3/2/1:850
   111.111.111.62/31                                          n/a
Test Space                       Up        Up/Down     IES     3/1/12:0
   111.111.111.62/29                                           n/a
ANOTHER_servic                   Up        Up/Up       IES     rvpls
   111.111.111.62/28                                          n/a
   111.111.111.62/64                                          PREFERRED
  • As you can see, it's possible to configure interface with a space in the name e.g. Test Space

@jvanderaa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this allows for you to make your own interfaces. That is the new part to me.

@Kani999
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the interfaces are handled differently for Nokia devices.
I tried to edit the regex but with no luck yet.

Please sign in to comment.