networktocode/ntc-templates

juniper_junos_show_chassis_hardware - skipping tags

Closed this issue · 3 comments

ISSUE TYPE Template Issue with error and raw data
TEMPLATE USING
Value Filldown FPC (\d+)
Value Filldown MIC (\d+)
Value Filldown PIC (\d+)
Value XCVR (\d+)
Value PART (\S+)
Value SERIAL (\S+)
Value DESCRIPTION (\S+)

Start
  ^Hardware.*
  ^Item\s+Version\s+Part\s+number\s+Serial\s+number\s+Description\s*$$
  ^\s*(Chassis|Midplane|Pseudo|FPM|Routing\s+Engine|Mi\S+|CB|AFEB|Routing|PEM|TFEB|CPU|QXM|Power\s+Supply|Fan\s+Tray).*
  ^.*FPC\s+${FPC}.*$$ -> FPC
  ^{master
  ^\s*$$
  ^. -> Error

FPC
  ^\s*FPC\s+${FPC}
  ^\s*MIC\s+${MIC}
  ^\s*PIC\s+${PIC} -> XCVR
  ^\s*CPU
  ^\s*$$
  ^. -> Error

XCVR
  ^\s*Xcvr\s+${XCVR}\s+(REV\s+(|\d+)|]|)\s+${PART}\s+${SERIAL}\s+${DESCRIPTION} -> Record
  ^\s*FPC\s+${FPC} -> FPC
  ^\s*MIC\s+${MIC} -> FPC
  ^\s*PIC\s+${PIC}
  ^\s*(Chassis|Midplane|Pseudo|FPM|Routing\s+Engine|Mi\S+|CB|AFEB|Routing|PEM|TFEB|CPU|QXM|Power\s+Supply|Fan\s+Tray).* -> Start
  ^\s*$$
  ^. -> Error

EOF

SAMPLE COMMAND OUTPUT
Hardware inventory:
Item             Version  Part number  Serial number     Description
Chassis                                XH0000000700      JNP48Y8C-CHAS
Pseudo CB 0     
Routing Engine 0          BUILTIN      BUILTIN           RE-QFX5120-48Y-8C
FPC 0            REV 16   650-083242   XH0000000700      JNP48Y8C-CHAS
  CPU                     BUILTIN      BUILTIN           FPC CPU
  PIC 0                   BUILTIN      BUILTIN           48x25G-8x100G
    Xcvr 48      REV 01   740-061409   1G3XXXXXXXXXX     QSFP-100GBASE-LR4-T2
    Xcvr 49      REV 01   740-061409   1G4XXXXXXXXXX     QSFP-100GBASE-LR4-T2
Power Supply 0   REV 04   740-070749   1F111111111       JPSU-650W-AC-AO
Power Supply 1   REV 04   740-070749   1F111111111       JPSU-650W-AC-AO
Fan Tray 0                                               fan-ctrl-0 0, Front to Back Airflow - AFO
Fan Tray 1                                               fan-ctrl-0 1, Front to Back Airflow - AFO
Fan Tray 2                                               fan-ctrl-1 2, Front to Back Airflow - AFO
Fan Tray 3                                               fan-ctrl-1 3, Front to Back Airflow - AFO
Fan Tray 4                                               fan-ctrl-2 4, Front to Back Airflow - AFO
SUMMARY

(Numbers/serials hidden to protect the innocent!)
In parsing the output only includes the two QSFP modules from the above chassis hardware, we don't get any of the chassis itself "FPC 0 REV 16 650-083242 XH0000000700 JNP48Y8C-CHAS"
or other components that have serial numbers.

EXPECTED RESULTS
ACTUAL RESULTS
Parsed output
[{'description': 'QSFP-100GBASE-LR4-T2',
  'fpc': '0',
  'mic': '',
  'part': '740-061409',
  'pic': '0',
  'serial': '1G3XXXXXXXXXX',
  'xcvr': '48'},
 {'description': 'QSFP-100GBASE-LR4-T2',
  'fpc': '0',
  'mic': '',
  'part': '740-061409',
  'pic': '0',
  'serial': '1G4XXXXXXXXXX',
  'xcvr': '49'}]

A PR for a proposed fix has been submitted for this issue and is waiting to be reviewed. The PR number is 1562.

@jvanderaa
#1562 shows as merged so this issue could be closed/resolved.