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

juniper junos_show_interfaces not parsing correctly #1376

Closed
andyb2000 opened this issue May 26, 2023 · 0 comments · Fixed by #1392
Closed

juniper junos_show_interfaces not parsing correctly #1376

andyb2000 opened this issue May 26, 2023 · 0 comments · Fixed by #1392

Comments

@andyb2000
Copy link

ISSUE TYPE
  • Template Issue with error and raw data
TEMPLATE USING

./ntc_templates/templates/juniper_junos_show_interfaces.textfsm

Value Required INTERFACE (\S+)
Value LINK_STATUS (\w+)
Value ADMIN_STATE (\S+)
Value HARDWARE_TYPE (\S+)
Value DESCRIPTION (\w+.*)
Value DESTINATION (\S+)
Value LOCAL (\S+)
Value MTU (\d+|Unlimited)

Start
  ^\s*\S+\s+interface -> Continue.Record
  ^Physical\s+interface:\s+${INTERFACE},\s+${ADMIN_STATE},\s+Physical\s+link\s+is\s+${LINK_STATUS}
  ^.*Description:\s+${DESCRIPTION}
  ^.*ype:\s+${HARDWARE_TYPE},.*MTU:\s+${MTU}.*
  ^\s+Logical\s+interface\s+${INTERFACE}
  ^.*Destination:\s+${DESTINATION},\s+Local:\s+${LOCAL},.*
  ^\s*$$
  ^{master:\d+}

SAMPLE COMMAND OUTPUT
Physical interface: xe-0/1/0, Enabled, Physical link is Up
  Interface index: 153, SNMP ifIndex: 564
  Description: ### My description - remote host - remote location - feature codes - info here ###
  Link-level type: Ethernet, MTU: 9114, MRU: 9122, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, Loop Detect PDU Error: None, MAC-REWRITE Error: None, Loopback: None, Source filtering: Disabled, Flow control: Enabled, Speed Configuration: 1G
  Pad to minimum frame size: Disabled
  Device flags   : Present Running
  Interface flags: SNMP-Traps Internal: 0x4000
  Link flags     : None
  CoS queues     : 8 supported, 8 maximum usable queues
  Schedulers     : 0
  Current address: 0a:aa:aa:aa:aa:aa, Hardware address: 0a:aa:aa:aa:aa:aa
  Last flapped   : 2022-07-28 21:30:59 GMT (43w0d 15:54 ago)
  Input rate     : 648 bps (1 pps)
  Output rate    : 968 bps (0 pps)
  Active alarms  : None
  Active defects : None
  PCS statistics                      Seconds
    Bit errors                             1
    Errored blocks                         0
  Interface transmit statistics: Disabled
EXPECTED RESULTS

parsing of description, IP, mac address, etc.

ACTUAL RESULTS
{'admin_state': 'Enabled',
  'description': '',
  'destination': '',
  'hardware_type': 'Ethernet',
  'interface': 'xe-0/1/0',
  'link_status': 'Up',
  'local': '',
  'mtu': '9114'},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant