Description
Hello
I'm new to ttp and I find it extremely useful for managing network equipment.
I've hit a few bumps and I wonder if that is an issue or I'm missing something
I'm using http://textfsm.nornir.tech/ to develop/troubleshoot templates and the templates work flawlessly there.
When used on my ubuntu (Linux mgmtuntu 5.4.0-80-generic) I'm getting lots of issues with parsing.
root@mgmtuntu:/home/admin1/ttp/portint# python3 --version
Python 3.8.10
A simple example with HPE Compare switch output (disp int brief, truncated to include just a few interfaces ):
device output:
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
REG0 UP -- --
Vlan401 UP UP 10.251.147.36 HSSBC_to_inband_mgmt_r4
Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
BAGG1 UP 20G(a) F(a) T 1 to-KDC-R4.10-Core-1
BAGG14 UP 10G(a) F(a) T 1 KDC-R429-E1 BackUp Chassis
BAGG22 UP 20G(a) F(a) T 1 HSSBC-NS-01
FGE1/0/49 DOWN auto A A 1
XGE1/0/1 UP 10G(a) F(a) T 1 KDC-R402-E1 Backup Chassis
Template:
Brief information on interfaces in route mode: {{ start }}
Interface Link Protocol Primary_IP Description {{ headers }}
{{ end}}
Result with the nornir.tech ( works as expected)
[
{
"interfaces": {
"bridged": {
"BAGG1": {
"Description": "to-KDC-R4.10-Core-1",
"Duplex": "F(a)",
"Link": "UP",
"PVID": "1",
"Speed": "20G(a)",
"Type": "T"
},
"BAGG14": {
"Description": "KDC-R429-E1 BackUp Chassis",
"Duplex": "F(a)",
"Link": "UP",
"PVID": "1",
"Speed": "10G(a)",
"Type": "T"
},
"BAGG22": {
"Description": "HSSBC-NS-01",
"Duplex": "F(a)",
"Link": "UP",
"PVID": "1",
"Speed": "20G(a)",
"Type": "T"
},
"FGE1/0/49": {
"Description": "",
"Duplex": "A",
"Link": "DOWN",
"PVID": "1",
"Speed": "auto",
"Type": "A"
},
"XGE1/0/1": {
"Description": "KDC-R402-E1 Backup Chassis",
"Duplex": "F(a)",
"Link": "UP",
"PVID": "1",
"Speed": "10G(a)",
"Type": "T"
}
},
"routed": {
"InLoop0": {
"Description": "",
"Link": "UP",
"Primary_IP": "--",
"Protocol": "UP(s)"
},
"REG0": {
"Description": "",
"Link": "UP",
"Primary_IP": "--",
"Protocol": "--"
},
"Vlan401": {
"Description": "HSSBC_to_inband_mgmt_r4",
"Link": "UP",
"Primary_IP": "10.251.147.36",
"Protocol": "UP"
}
}
}
}
]
Cli tool / ttp 0.5-0.6-0.7-0.8 produces mixed up output
root@mgmtuntu:/home/admin1/ttp/portint# ttp --data "cmw7-disp-int-brief.txt" --template "../templates/hp_cmw7_display_interface_brief.ttp" -l ERROR -o yaml
-
- interfaces:
routed:
BAGG1:
Description: to-KDC-R4.10-Core-1
Link: UP
Primary_IP: (a) T 1
Protocol: 20G(a) F
BAGG14:
Description: KDC-R429-E1 BackUp Chassis
Link: UP
Primary_IP: (a) T 1
Protocol: 10G(a) F
BAGG22:
Description: HSSBC-NS-01
Link: UP
Primary_IP: (a) T 1
Protocol: 20G(a) F
Brief information on:
- Description: ''
Link: inter
Primary_IP: 'route mode:'
Protocol: faces in
- Description: ''
Link: inter
Primary_IP: 'bridge mode:'
Protocol: faces in
'Duplex: (a)/A - auto;':
Description: ''
Link: H -
Primary_IP: full
Protocol: half; F -
FGE1/0/49:
Description: ''
Link: DOWN
Primary_IP: A 1
Protocol: auto A
InLoop0:
Description: ''
Link: UP
Primary_IP: --
Protocol: UP(s)
'Link: ADM - administr':
- Description: ''
Link: ative
Primary_IP: Stby - standby
Protocol: ly down;
- Description: ''
Link: ative
Primary_IP: Stby - standby
Protocol: ly down;
REG0:
Description: ''
Link: UP
Primary_IP: --
Protocol: --
'Type: A - access; T -':
Description: ''
Link: trun
Primary_IP: brid
Protocol: k; H - hy
Vlan401:
Description: HSSBC_to_inband_mgmt_r4
Link: UP
Primary_IP: 10.251.147.36
Protocol: UP
XGE1/0/1:
Description: KDC-R402-E1 Backup Chassis
Link: UP
Primary_IP: (a) T 1
Protocol: 10G(a) F
- interfaces: