hp_procurve_show_interfaces_brief error handling
Closed this issue ยท 11 comments
First off, thanks so much for creating the hp_procurve templates!
In issue 1405, error handling was added to the hp_procurve templates.
I also hit a similar exception on the hp_procurve_show_vlans template when the switch has a loopback configured.
I removed " ^. -> Error" on line 17 and the template worked for the interfaces brief.
Same thing for line 27 of the vlan template.
I read the article here:
https://pyneng.readthedocs.io/en/latest/book/21_textfsm/textfsm_syntax.html
but I don't understand what would be needed to allow the "Note: * indicates values dynamically overridden by RADIUS." line to be ignored and continue processing.
I'm new to the textfsm parser, if you need any additional information just let me know and I can provide more and do testing.
Thanks!
ISSUE TYPE
- Template Issue with error and raw data
TEMPLATE USING
SAMPLE COMMAND OUTPUT
Please paste the raw output of the show command your are you using.
Status and Counters - Port Status
Note: * indicates values dynamically overridden by RADIUS.
| Intrusion MDI Flow Bcast
Port Type | Alert Enabled Status Mode Mode Ctrl Limit
------------ ---------- + --------- ------- ------ ---------- ---- ---- -----
A1 1000SX | No Yes Up 1000FDx NA off 0
A2 1000SX | No Yes Up 1000FDx NA off 0
A3 1000SX | No Yes Up 1000FDx NA off 0
A4 1000SX | No Yes Up 1000FDx NA off 0
A5 1000SX | No Yes Up 1000FDx NA off 0
A6 1000SX | No Yes Up 1000FDx NA off 0
A7 1000SX | No Yes Up 1000FDx NA off 0
A8* SFP+SR | No Yes Up 10GigFD NA off 0
B1 1000SX | No Yes Up 1000FDx NA off 0
B2 1000SX | No Yes Up 1000FDx NA off 0
B3 1000SX | No Yes Up 1000FDx NA off 0
B4 1000SX | No Yes Up 1000FDx NA off 0
B5 1000SX | No Yes Up 1000FDx NA off 0
B6 1000SX | No Yes Up 1000FDx NA off 0
B7* 1000SX | No Yes Up 1000FDx NA off 0
B8 SFP+SR | No Yes Up 10GigFD NA off 0
C1 100/1000T | No Yes Up 1000FDx MDIX off 0
C2 100/1000T | No Yes Up 1000FDx MDI off 0
C3 100/1000T | No Yes Up 100FDx MDIX off 0
C4 100/1000T | No Yes Up 100FDx MDIX off 0
C5 100/1000T | No Yes Up 1000FDx MDI off 0
C6 100/1000T | No Yes Up 1000FDx MDIX off 0
C7 100/1000T | No Yes Up 1000FDx MDIX off 0
C8 100/1000T | No Yes Up 1000FDx MDI off 0
C9 100/1000T | No Yes Up 1000FDx MDIX off 0
C10 100/1000T | No Yes Up 1000FDx MDIX off 0
C11 100/1000T | No Yes Up 100FDx MDIX off 0
C12 100/1000T | No Yes Up 1000FDx MDI off 0
C13 100/1000T | No Yes Up 1000FDx MDIX off 0
C14 100/1000T | No Yes Up 1000FDx MDI off 0
C15 100/1000T | No Yes Up 1000FDx MDI off 0
C16 100/1000T | No Yes Up 1000FDx MDI off 0
C17 100/1000T | No Yes Up 100FDx MDI off 0
C18 100/1000T | No Yes Up 1000FDx MDIX off 0
C19 100/1000T | No Yes Up 100FDx MDI off 0
C20 100/1000T | No Yes Up 1000FDx MDIX off 0
C21 100/1000T | No Yes Up 1000FDx MDI off 0
C22 100/1000T | No Yes Up 1000FDx MDIX off 0
C23 100/1000T | No Yes Up 1000FDx MDIX off 0
C24 100/1000T | No Yes Up 1000FDx MDIX off 0
D1-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D2-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D3-Trk1 100/1000T | No Yes Up 1000FDx MDI off 0
D4-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D5 100/1000T | No No Down 1000FDx NA off 0
D6 100/1000T | No Yes Down 1000FDx NA off 0
D7 100/1000T | No Yes Down 1000FDx Auto off 0
D8 100/1000T | No Yes Down 1000FDx NA off 0
D9 100/1000T | No Yes Down 1000FDx NA off 0
D10 100/1000T | No Yes Down 1000FDx NA off 0
D11 100/1000T | No Yes Up 100FDx MDI off 0
D12 100/1000T | No Yes Down 1000FDx NA off 0
D13 100/1000T | No Yes Down 1000FDx Auto off 0
D14 100/1000T | No Yes Down 1000FDx NA off 0
D15 100/1000T | No Yes Down 1000FDx NA off 0
D16 100/1000T | No Yes Down 1000FDx Auto off 0
D17 100/1000T | No Yes Down 1000FDx NA off 0
D18 100/1000T | No Yes Up 100FDx MDI off 0
D19 100/1000T | No Yes Down 1000FDx NA off 0
D20 100/1000T | No Yes Down 1000FDx Auto off 0
D21 100/1000T | No Yes Down 1000FDx Auto off 0
D22 100/1000T | No Yes Down 1000FDx NA off 0
D23 100/1000T | No Yes Down 1000FDx Auto off 0
D24 100/1000T | No Yes Down 1000FDx Auto off 0
E1 SFP+DA3 | No No Down 10GigFD NA off 0
E2 SFP+DA3 | No No Down 10GigFD NA off 0
E3 | No Yes Down . off 0
E4 | No Yes Down . off 0
E5 | No Yes Down . off 0
E6 | No Yes Down . off 0
E7 SFP+SR | No Yes Up 10GigFD NA off 0
E8 SFP+SR | No Yes Up 10GigFD NA off 0
F1 10GbE-T | No Yes Up 2500FDx* MDI off 0
F2 10GbE-T | No Yes Up 2500FDx* MDI off 0
F3 10GbE-T | No Yes Up 2500FDx* MDI off 0
F4 10GbE-T | No Yes Up 2500FDx* MDIX off 0
F5 10GbE-T | No Yes Up 2500FDx* MDI off 0
F6 10GbE-T | No Yes Down 10GigFD NA off 0
F7 10GbE-T | No Yes Up 2500FDx* MDI off 0
F8 10GbE-T | No Yes Up 10GigFD MDIX off 0
G1 100/1000T | No Yes Up 100FDx MDIX off 0
G2 100/1000T | No Yes Up 100FDx MDI off 0
G3 100/1000T | No Yes Up 1000FDx MDI off 0
G4 100/1000T | No Yes Up 1000FDx MDI off 0
G5 100/1000T | No Yes Up 100FDx MDI off 0
G6 100/1000T | No Yes Up 100FDx MDI off 0
G7 100/1000T | No Yes Up 100FDx MDI off 0
G8 100/1000T | No Yes Up 100FDx MDI off 0
G9 100/1000T | No Yes Up 1000FDx MDIX off 0
G10 100/1000T | No Yes Up 1000FDx MDIX off 0
G11 100/1000T | No Yes Up 1000FDx MDIX off 0
G12 100/1000T | No Yes Up 1000FDx MDIX off 0
G13 100/1000T | No Yes Up 1000FDx MDI off 0
G14 100/1000T | No Yes Up 1000FDx MDIX off 0
G15 100/1000T | No Yes Up 100FDx MDIX off 0
G16 100/1000T | No Yes Up 100FDx MDI off 0
G17 100/1000T | No Yes Up 1000FDx* MDIX off 0
G18 100/1000T | No Yes Down 1000FDx NA off 0
G19 100/1000T | No Yes Up 1000FDx* MDI off 0
G20 100/1000T | No Yes Up 100FDx MDI off 0
G21 100/1000T | No Yes Down 1000FDx NA off 0
G22 100/1000T | No Yes Down 1000FDx NA off 0
G23 100/1000T | No Yes Up 100FDx MDIX off 0
G24 100/1000T | No Yes Up 1000FDx MDI off 0
H1 100/1000T | No Yes Down 1000FDx NA off 0
H2 100/1000T | No Yes Down 1000FDx Auto off 0
H3 100/1000T | No Yes Down 1000FDx NA off 0
H4 100/1000T | No Yes Down 1000FDx Auto off 0
H5 100/1000T | No Yes Down 1000FDx Auto off 0
H6 100/1000T | No Yes Down 1000FDx Auto off 0
H7 100/1000T | No Yes Down 1000FDx Auto off 0
H8 100/1000T | No Yes Down 1000FDx Auto off 0
H9 100/1000T | No Yes Down 1000FDx Auto off 0
H10 100/1000T | No Yes Down 1000FDx Auto off 0
H11 100/1000T | No Yes Down 1000FDx Auto off 0
H12 100/1000T | No Yes Down 1000FDx Auto off 0
H13 100/1000T | No Yes Down 1000FDx Auto off 0
H14 100/1000T | No Yes Down 1000FDx Auto off 0
H15 100/1000T | No Yes Down 1000FDx Auto off 0
H16 100/1000T | No Yes Down 1000FDx Auto off 0
H17 100/1000T | No Yes Down 1000FDx Auto off 0
H18 100/1000T | No Yes Down 1000FDx Auto off 0
H19 100/1000T | No Yes Down 1000FDx Auto off 0
H20 100/1000T | No Yes Down 1000FDx Auto off 0
H21 100/1000T | No Yes Down 1000FDx Auto off 0
H22 100/1000T | No Yes Down 1000FDx Auto off 0
H23 100/1000T | No Yes Up 100FDx MDI off 0
H24 100/1000T | No Yes Up 100FDx MDI off 0
- third-party transceiver
SUMMARY
STEPS TO REPRODUCE
EXPECTED RESULTS
[
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.71.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.248.0",
"VLAN_NAME": "DEFAULT_VLAN"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.30.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "AP-575-Bridge-Tea..."
},
{
"CONFIG": "Disabled",
"IP_ADDRESS": "",
"LOCAL": "",
"PROXY": "",
"SUBNET_MASK": "",
"VLAN_NAME": "VLAN 72 vMotion N..."
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.74.30",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.224",
"VLAN_NAME": "VM_ESXI_CLUSTER_M..."
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.23.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "SERVER_VLAN_75"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.95.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.248.0",
"VLAN_NAME": "VLAN 88 Wireless ..."
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.201.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.254.0",
"VLAN_NAME": "VLAN 200 RHS ROP"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.203.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.254.0",
"VLAN_NAME": "Mountain HS"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.204.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "MOT LAN"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.2.126",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.128",
"VLAN_NAME": "575-Outdoor-APs"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.63.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.248.0",
"VLAN_NAME": "Staff/Student Wir..."
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.254.254",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "Device Management"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.112.1.2",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "Spectrum ME3400 G1"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.1.0.251",
"LOCAL": "No",
"PROXY": "No",
"SUBNET_MASK": "255.255.255.0",
"VLAN_NAME": "Fortigate P2"
},
{
"CONFIG": "IP",
"IP_ADDRESS": "Config",
"LOCAL": "",
"PROXY": "",
"SUBNET_MASK": "IP",
"VLAN_NAME": "Loopback"
},
{
"CONFIG": "Manual",
"IP_ADDRESS": "10.2.2.2",
"LOCAL": "",
"PROXY": "",
"SUBNET_MASK": "255.255.255.255",
"VLAN_NAME": "lo1"
}
]
ACTUAL RESULTS
A fatal exception
Exception has occurred: TextFSMError
State Error raised. Rule Line: 17. Input Line: Note: * indicates values dynamically overridden by RADIUS.
File "/Discovery/procurve_Config_pull.py", line 306, in <module>
output_show_int_br = net_connect.send_command(
^^^^^^^^^^^^^^^^^^^^^^^^^
textfsm.parser.TextFSMError: State Error raised. Rule Line: 17. Input Line: Note: * indicates values dynamically overridden by RADIUS.
What is likely happening here @rikosintie is that there is an unaccounted for line. The output of Note: * indicates values dynamically overridden by RADIUS.
just needs to get added to the template such as https://github.com/networktocode/ntc-templates/blob/master/ntc_templates/templates/cisco_ios_show_boot.textfsm#L41
If you want to try to take a stab at fixing it, that is terrific. If some additional help is needed, please send us an example output.
Thanks for the response, I will take a look tomorrow!
If you want to try to take a stab at fixing it, that is terrific. If some additional help is needed, please send us an example output.
@rikosintie
If you'd like an assist on this I'm willing to take a look.
Please provide sample raw output returned by show interfaces brief
on your HP Procurve switch in either a code block OR attach a plain text file containing the raw output to this issue (paper clip icon).
Hello @rikosintie
I hope you're doing well and see this notification.
Your intitial post had the raw output split between a code block and plain text. Hopefully none of the formatting got messed up too badly.
(for absolute confidence in the raw output...)
Would you please provide sample raw output from show interfaces brief on your HP Procurve switch?
Thank you!
I figure the below output might be correctly formatted, but it's better to check with you to be sure.
Status and Counters - Port Status
Note: * indicates values dynamically overridden by RADIUS.
| Intrusion MDI Flow Bcast
Port Type | Alert Enabled Status Mode Mode Ctrl Limit
------------ ---------- + --------- ------- ------ ---------- ---- ---- -----
A1 1000SX | No Yes Up 1000FDx NA off 0
A2 1000SX | No Yes Up 1000FDx NA off 0
A3 1000SX | No Yes Up 1000FDx NA off 0
A4 1000SX | No Yes Up 1000FDx NA off 0
A5 1000SX | No Yes Up 1000FDx NA off 0
A6 1000SX | No Yes Up 1000FDx NA off 0
A7 1000SX | No Yes Up 1000FDx NA off 0
A8* SFP+SR | No Yes Up 10GigFD NA off 0
B1 1000SX | No Yes Up 1000FDx NA off 0
B2 1000SX | No Yes Up 1000FDx NA off 0
B3 1000SX | No Yes Up 1000FDx NA off 0
B4 1000SX | No Yes Up 1000FDx NA off 0
B5 1000SX | No Yes Up 1000FDx NA off 0
B6 1000SX | No Yes Up 1000FDx NA off 0
B7* 1000SX | No Yes Up 1000FDx NA off 0
B8 SFP+SR | No Yes Up 10GigFD NA off 0
C1 100/1000T | No Yes Up 1000FDx MDIX off 0
C2 100/1000T | No Yes Up 1000FDx MDI off 0
C3 100/1000T | No Yes Up 100FDx MDIX off 0
C4 100/1000T | No Yes Up 100FDx MDIX off 0
C5 100/1000T | No Yes Up 1000FDx MDI off 0
C6 100/1000T | No Yes Up 1000FDx MDIX off 0
C7 100/1000T | No Yes Up 1000FDx MDIX off 0
C8 100/1000T | No Yes Up 1000FDx MDI off 0
C9 100/1000T | No Yes Up 1000FDx MDIX off 0
C10 100/1000T | No Yes Up 1000FDx MDIX off 0
C11 100/1000T | No Yes Up 100FDx MDIX off 0
C12 100/1000T | No Yes Up 1000FDx MDI off 0
C13 100/1000T | No Yes Up 1000FDx MDIX off 0
C14 100/1000T | No Yes Up 1000FDx MDI off 0
C15 100/1000T | No Yes Up 1000FDx MDI off 0
C16 100/1000T | No Yes Up 1000FDx MDI off 0
C17 100/1000T | No Yes Up 100FDx MDI off 0
C18 100/1000T | No Yes Up 1000FDx MDIX off 0
C19 100/1000T | No Yes Up 100FDx MDI off 0
C20 100/1000T | No Yes Up 1000FDx MDIX off 0
C21 100/1000T | No Yes Up 1000FDx MDI off 0
C22 100/1000T | No Yes Up 1000FDx MDIX off 0
C23 100/1000T | No Yes Up 1000FDx MDIX off 0
C24 100/1000T | No Yes Up 1000FDx MDIX off 0
D1-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D2-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D3-Trk1 100/1000T | No Yes Up 1000FDx MDI off 0
D4-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D5 100/1000T | No No Down 1000FDx NA off 0
D6 100/1000T | No Yes Down 1000FDx NA off 0
D7 100/1000T | No Yes Down 1000FDx Auto off 0
D8 100/1000T | No Yes Down 1000FDx NA off 0
D9 100/1000T | No Yes Down 1000FDx NA off 0
D10 100/1000T | No Yes Down 1000FDx NA off 0
D11 100/1000T | No Yes Up 100FDx MDI off 0
D12 100/1000T | No Yes Down 1000FDx NA off 0
D13 100/1000T | No Yes Down 1000FDx Auto off 0
D14 100/1000T | No Yes Down 1000FDx NA off 0
D15 100/1000T | No Yes Down 1000FDx NA off 0
D16 100/1000T | No Yes Down 1000FDx Auto off 0
D17 100/1000T | No Yes Down 1000FDx NA off 0
D18 100/1000T | No Yes Up 100FDx MDI off 0
D19 100/1000T | No Yes Down 1000FDx NA off 0
D20 100/1000T | No Yes Down 1000FDx Auto off 0
D21 100/1000T | No Yes Down 1000FDx Auto off 0
D22 100/1000T | No Yes Down 1000FDx NA off 0
D23 100/1000T | No Yes Down 1000FDx Auto off 0
D24 100/1000T | No Yes Down 1000FDx Auto off 0
E1 SFP+DA3 | No No Down 10GigFD NA off 0
E2 SFP+DA3 | No No Down 10GigFD NA off 0
E3 | No Yes Down . off 0
E4 | No Yes Down . off 0
E5 | No Yes Down . off 0
E6 | No Yes Down . off 0
E7 SFP+SR | No Yes Up 10GigFD NA off 0
E8 SFP+SR | No Yes Up 10GigFD NA off 0
F1 10GbE-T | No Yes Up 2500FDx* MDI off 0
F2 10GbE-T | No Yes Up 2500FDx* MDI off 0
F3 10GbE-T | No Yes Up 2500FDx* MDI off 0
F4 10GbE-T | No Yes Up 2500FDx* MDIX off 0
F5 10GbE-T | No Yes Up 2500FDx* MDI off 0
F6 10GbE-T | No Yes Down 10GigFD NA off 0
F7 10GbE-T | No Yes Up 2500FDx* MDI off 0
F8 10GbE-T | No Yes Up 10GigFD MDIX off 0
G1 100/1000T | No Yes Up 100FDx MDIX off 0
G2 100/1000T | No Yes Up 100FDx MDI off 0
G3 100/1000T | No Yes Up 1000FDx MDI off 0
G4 100/1000T | No Yes Up 1000FDx MDI off 0
G5 100/1000T | No Yes Up 100FDx MDI off 0
G6 100/1000T | No Yes Up 100FDx MDI off 0
G7 100/1000T | No Yes Up 100FDx MDI off 0
G8 100/1000T | No Yes Up 100FDx MDI off 0
G9 100/1000T | No Yes Up 1000FDx MDIX off 0
G10 100/1000T | No Yes Up 1000FDx MDIX off 0
G11 100/1000T | No Yes Up 1000FDx MDIX off 0
G12 100/1000T | No Yes Up 1000FDx MDIX off 0
G13 100/1000T | No Yes Up 1000FDx MDI off 0
G14 100/1000T | No Yes Up 1000FDx MDIX off 0
G15 100/1000T | No Yes Up 100FDx MDIX off 0
G16 100/1000T | No Yes Up 100FDx MDI off 0
G17 100/1000T | No Yes Up 1000FDx* MDIX off 0
G18 100/1000T | No Yes Down 1000FDx NA off 0
G19 100/1000T | No Yes Up 1000FDx* MDI off 0
G20 100/1000T | No Yes Up 100FDx MDI off 0
G21 100/1000T | No Yes Down 1000FDx NA off 0
G22 100/1000T | No Yes Down 1000FDx NA off 0
G23 100/1000T | No Yes Up 100FDx MDIX off 0
G24 100/1000T | No Yes Up 1000FDx MDI off 0
H1 100/1000T | No Yes Down 1000FDx NA off 0
H2 100/1000T | No Yes Down 1000FDx Auto off 0
H3 100/1000T | No Yes Down 1000FDx NA off 0
H4 100/1000T | No Yes Down 1000FDx Auto off 0
H5 100/1000T | No Yes Down 1000FDx Auto off 0
H6 100/1000T | No Yes Down 1000FDx Auto off 0
H7 100/1000T | No Yes Down 1000FDx Auto off 0
H8 100/1000T | No Yes Down 1000FDx Auto off 0
H9 100/1000T | No Yes Down 1000FDx Auto off 0
H10 100/1000T | No Yes Down 1000FDx Auto off 0
H11 100/1000T | No Yes Down 1000FDx Auto off 0
H12 100/1000T | No Yes Down 1000FDx Auto off 0
H13 100/1000T | No Yes Down 1000FDx Auto off 0
H14 100/1000T | No Yes Down 1000FDx Auto off 0
H15 100/1000T | No Yes Down 1000FDx Auto off 0
H16 100/1000T | No Yes Down 1000FDx Auto off 0
H17 100/1000T | No Yes Down 1000FDx Auto off 0
H18 100/1000T | No Yes Down 1000FDx Auto off 0
H19 100/1000T | No Yes Down 1000FDx Auto off 0
H20 100/1000T | No Yes Down 1000FDx Auto off 0
H21 100/1000T | No Yes Down 1000FDx Auto off 0
H22 100/1000T | No Yes Down 1000FDx Auto off 0
H23 100/1000T | No Yes Up 100FDx MDI off 0
H24 100/1000T | No Yes Up 100FDx MDI off 0
Hello @mjbear
Thanks so much for looking at this! Sorry for the long delay, I had surgery and am not back to work yet. The switch is at a customer site and my account had expired so I had to back channel the request to enable VPN for me.
But I got it! My vpn access will active for a while now, so if you need anything else I can respond much faster.
Thanks!
Hello @rikosintie
The delay is understandable.
I hope you heal quick from the surgery.
๐ฏ For any raw output line, we need a pattern to at least match the line (even if we don't tell TextFSM to perform an action such as Record
). So in that case there are a few examples for the Status and also for blank lines (see snippet below).
Start
^\s+Status.*Status\s*
^\s*$$
In this case the Note is before the template starts matching ports so the additional pattern (in this case for a line to ignore) needs to happen in that Start
state section.
โ๏ธ The pattern I worked up is as follows: ^\s*Note:\s*\*.*$$
(Ultimately my hope is this will match the current and any future "Note:" lines. ๐)
That's all that is needed for this particular issue. When it comes to (understanding) the rest of this template's flow anytime the column headers are encountered (in this template) that is when a state change happens (ex: showintbrief1
or showintbrief2
).
โ Curiosity...I don't have experience with HP ProCurve gear. Am I right in figuring that A, B, etc through K are individual switch members in a stack?
๐ก Since your raw output is quite a bit different than those already in the test data, I'm going to trim down the duplicate lines and include it.
Status and Counters - Port Status
Note: * indicates values dynamically overridden by RADIUS.
| Intrusion MDI Flow Bcast
Port Type | Alert Enabled Status Mode Mode Ctrl Limit
------------ ---------- + --------- ------- ------ ---------- ---- ---- -----
A1 1000SX | No Yes Up 1000FDx NA off 0
A8* SFP+SR | No Yes Up 10GigFD NA off 0
B1 1000SX | No Yes Up 1000FDx NA off 0
B7* 1000SX | No Yes Up 1000FDx NA off 0
B8 SFP+SR | No Yes Up 10GigFD NA off 0
C1 100/1000T | No Yes Up 1000FDx MDIX off 0
C2 100/1000T | No Yes Up 1000FDx MDI off 0
C4 100/1000T | No Yes Up 100FDx MDIX off 0
D1-Trk1 100/1000T | No Yes Up 1000FDx MDIX off 0
D5 100/1000T | No No Down 1000FDx NA off 0
D7 100/1000T | No Yes Down 1000FDx Auto off 0
E1 SFP+DA3 | No No Down 10GigFD NA off 0
E3 | No Yes Down . off 0
F1 10GbE-T | No Yes Up 2500FDx* MDIX off 0
F2 10GbE-T | No Yes Up 2500FDx* MDI off 0
G17 100/1000T | No Yes Up 1000FDx* MDIX off 0
G18 100/1000T | No Yes Down 1000FDx NA off 0
* third-party transceiver
@rikosintie
I purposely created a new comment here because I wanted to call out a few things I noticed that I probably should account for before submitting a PR with changes.
There are two legends that use the asterisk character (RADIUS and third-party transceiver). ๐ค
- A8 has an asterisk beside it, which might indicate something is overridden by RADIUS?
- F1, F2, and G17 have an asterisk after their Mode (ex: 2500FDx*). Is that relative to the overridden note too?
- What about that asterisk and "third-party transceiver" at the bottom? I'm guessing third-party just applies to the Type column.
The asterisk at a minimum should probably be excluded from the captured data for PORT and maybe MODE.
Maybe the asterisk is beneficial to capture in its own capture group (but then again maybe not) ... which is why I ask about its meaning in the two locations it is seen in your output (Port and Mode).
๐ฏ Please see if the output for show interfaces
is also similarly affected like this brief output is. If it is affected, open a new issue and supply the output so you and I can work up a solution. Sound good?
I matched the asterisk (ex: next to A8 or B7) so it would not be captured with the PORT
name.
I considered doing the same for MODE
data as well to maintain a level of normalization and because it probably shouldn't be captured with the mode. However the regex needs to change a bunch (noted below) and could potentially be more fragile than the looser/flexible \S*
.
# originally
Value MODE (\S*)
# modified
Value MODE ([a-zA-Z0-9\.]+)
# and then to modify the rules for the two output formats so MODE is optional (can be blank)
^\s+${PORT}\*?\s+${TYPE}\s+\|\s+${INTRUSION_ALERT}\s+${ENABLED}\s+${STATUS}\s+${MODE}?\*?\s+(?:${MDI_MODE}\s+)?${FLOW_CTRL}\s*$$ -> Record
... snipped ...
^\s+${PORT}\*?\s+${TYPE}\s+\|\s+${INTRUSION_ALERT}\s+${ENABLED}\s+${STATUS}\s+${MODE}?\*?\s+(?:${MDI_MODE}\s+)?${FLOW_CTRL}\s+${BCAST_LIMIT}\s*$$ -> Record
In my git diff
output we see that with all of these changes the asterisk is removed from the MODE
output.
- mode: "2500FDx*"
+ mode: "2500FDx"
@mjbear I would say it is probably preferred to not have the *
, but if it gets too complicated, then it isn't that big of an issue and not worth the effort
@mjbear I would say it is probably preferred to not have the
*
, but if it gets too complicated, then it isn't that big of an issue and not worth the effort
Thank you for the feedback @jmcgill298.
I don't think it's too complicated so I'll send in PR #1782 for review.