Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Template: juniper_junos_show_lacp_interfaces #713

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ juniper_junos_show_chassis_cluster_interfaces.textfsm, .*, juniper_junos, sh[[ow
juniper_junos_show_ethernet-switching_table.textfsm, .*, juniper_junos, sh[[ow]] et[[hernet-switching]] t[[able]]
juniper_junos_show_chassis_cluster_status.textfsm, .*, juniper_junos, sh[[ow]] ch[[assis]] c[[luster]] s[[tatus]]
juniper_junos_show_chassis_firmware.textfsm, .*, juniper_junos, sh[[ow]] ch[[assis]] fi[[rmware]]
juniper_junos_show_lacp_interfaces.textfsm, .*, juniper_junos, sh[[ow]] la[[cp]] i[[nterfaces]]
juniper_junos_show_arp_no-resolve.textfsm, .*, juniper_junos, sh[[ow]] a[[rp]] n[[o-resolve]]
juniper_junos_show_isis_adjacency.textfsm, .*, juniper_junos, sh[[ow]] is[[is]] ad[[jacency]]
juniper_junos_show_ospf_neighbor.textfsm, .*, juniper_junos, sh[[ow]] ospf n[[eighbor]]
Expand Down
11 changes: 11 additions & 0 deletions templates/juniper_junos_show_lacp_interfaces.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Value Required,Filldown AGGREGATED_INTERFACE (\S+)
Value List MEMBER_INTERFACE (\S+)
Value List RECEIVE_STATE (\S+\s?\w+)
Value List TRANSMIT_STATE (\S+\s?periodic)
Value List MUX_STATE (\S+\s?\S*)

Start
^Aggre -> Continue.Record
^Aggregated\sinterface:\s${AGGREGATED_INTERFACE}(\s|$$) -> Continue
^\s+${MEMBER_INTERFACE}\s+${RECEIVE_STATE}\s+${TRANSMIT_STATE}\s+${MUX_STATE}(\s|$$) -> Continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind restructuring this template a bit?

I think it may be good to act off the headers within the output for both the LACP state and LACP protocol.

Something like:

Value Required,Filldown AGGREGATED_INTERFACE (\S+)
Value List MEMBER_INTERFACE (\S+)
Value List RECEIVE_STATE (\S+\s?\w+)
Value List TRANSMIT_STATE (\S+\s?periodic)
Value List MUX_STATE (\S+\s?\S*)

Start
  ^Aggregated -> Continue.Record
  ^Aggregated\sinterface:\s${AGGREGATED_INTERFACE}(\s|$$) -> Continue
  ^LACP\s+state
  ^\s+\S+
  ^LACP\s+protocol -> LACP_PROTO
  ^\s*$$
  ^. -> Error

LACP_PROTO
  ^\s+${MEMBER_INTERFACE}\s+${RECEIVE_STATE}\s+${TRANSMIT_STATE}\s+${MUX_STATE}(\s|$$) -> Continue
  ^Aggregated -> Start
  ^\s*$$
  ^. -> Error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @FragmentedPacket

Thank you for the good suggestions.
I added LACP protocol header in the template.

Start
  ^Aggregated -> Continue.Record
  ^Aggregated\sinterface:\s${AGGREGATED_INTERFACE}(\s|$$) -> Continue
  ^\s+LACP\s+state: -> Continue
  ^\s+LACP\sprotocol: -> LACP_PROTO
  ^\s*$$
  ^{master:\d+}

LACP_PROTO
  ^\s+${MEMBER_INTERFACE}\s+${RECEIVE_STATE}\s+${TRANSMIT_STATE}\s+${MUX_STATE}(\s|$$) -> Continue
  ^\s*$$
  ^Aggregated -> Continue.Record
  ^Aggregated\sinterface:\s${AGGREGATED_INTERFACE}(\s|$$) -> Start


Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Aggregated interface: ae33
LACP state: Role Exp Def Dist Col Syn Aggr Timeout Activity
xe-0/0/0:0 Actor No No Yes Yes Yes Yes Fast Active
xe-0/0/0:0 Partner No No Yes Yes Yes Yes Slow Active
LACP protocol: Receive State Transmit State Mux State
xe-0/0/0:0 Current Slow periodic Collecting distributing

Aggregated interface: ae111
LACP state: Role Exp Def Dist Col Syn Aggr Timeout Activity
et-0/0/32 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/32 Partner No No Yes Yes Yes Yes Fast Active
et-0/0/33 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/33 Partner No No Yes Yes Yes Yes Fast Active
LACP protocol: Receive State Transmit State Mux State
et-0/0/32 Current Fast periodic Collecting distributing
et-0/0/33 Current Fast periodic Collecting distributing

Aggregated interface: ae112
LACP state: Role Exp Def Dist Col Syn Aggr Timeout Activity
et-0/0/34 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/34 Partner No No Yes Yes Yes Yes Fast Active
et-0/0/35 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/35 Partner No No Yes Yes Yes Yes Fast Active
LACP protocol: Receive State Transmit State Mux State
et-0/0/34 Current Fast periodic Collecting distributing
et-0/0/35 Current Fast periodic Collecting distributing

Aggregated interface: ae115
LACP state: Role Exp Def Dist Col Syn Aggr Timeout Activity
et-0/0/25 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/25 Partner No No Yes Yes Yes Yes Fast Active
et-0/0/29 Actor No No Yes Yes Yes Yes Fast Active
et-0/0/29 Partner No No Yes Yes Yes Yes Fast Active
LACP protocol: Receive State Transmit State Mux State
et-0/0/25 Current Fast periodic Collecting distributing
et-0/0/29 Current Fast periodic Collecting distributing

{master:0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
parsed_sample:
- aggregated_interface: "ae33"
member_interface:
- "xe-0/0/0:0"
receive_state:
- "Current"
transmit_state:
- "Slow periodic"
mux_state:
- "Collecting distributing"
- aggregated_interface: "ae111"
member_interface:
- "et-0/0/32"
- "et-0/0/33"
receive_state:
- "Current"
- "Current"
transmit_state:
- "Fast periodic"
- "Fast periodic"
mux_state:
- "Collecting distributing"
- "Collecting distributing"
- aggregated_interface: "ae112"
member_interface:
- "et-0/0/34"
- "et-0/0/35"
receive_state:
- "Current"
- "Current"
transmit_state:
- "Fast periodic"
- "Fast periodic"
mux_state:
- "Collecting distributing"
- "Collecting distributing"
- aggregated_interface: "ae115"
member_interface:
- "et-0/0/25"
- "et-0/0/29"
receive_state:
- "Current"
- "Current"
transmit_state:
- "Fast periodic"
- "Fast periodic"
mux_state:
- "Collecting distributing"
- "Collecting distributing"