Skip Dest/Network headers when Total routes is 0; capture direction from match groups; expose workbook compare/data/sheet stats and prefer batch aliases in compare/cutover pickers. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .. | ||
| cisco | ||
| h3c | ||
| huawei | ||
| juniper | ||
| zte | ||
| index | ||
| README.md | ||
NetX CLI TextFSM templates
Custom TextFSM templates that complement (and can override) community ntc-templates.
Organize by vendor folder; prefer adding templates here for every new CLI parse path.
Layout
cli_templates/
index # global index (paths relative to this dir)
README.md
zte/ # ZTE ZXROS / ROSNG, ...
cisco/ # overrides / extras beyond community cisco_*
huawei/
h3c/
juniper/
Lookup order
- Wrap-line join (
netx_api.cli_wrap) — flatten last-column wraps for registered platform+command pairs (ZTE interface brief / LLDP brief today). Other vendors can register rules the same way; do not apply blindly (Huawei LLDP detail uses real indented fields). - This tree (
index→vendor/*.textfsm) - Community
ntc-templatespackage
No regex CLI parsers for field extraction. If both template trees miss, the call returns empty — fix or add a template. Wrap joining is the supported escape hatch when TextFSM alone cannot merge mid-token column wraps.
Vendor coverage (blind fill from community + NetX)
| NetX vendor_key | ntc platform | LLDP command | Port brief | Port detail | Notes |
|---|---|---|---|---|---|
zte |
zte_zxros |
show lldp neighbor brief |
show interface brief |
show interface {if} |
NetX custom (community has iface only) |
huawei |
huawei_vrp |
display lldp neighbor |
display interface brief |
display interface {if} |
NetX custom (community prompt-fragile) |
cisco |
cisco_ios / nxos / xr |
show lldp neighbors detail |
show ip interface brief |
show interfaces {if} |
Community + NetX iface override |
h3c |
hp_comware |
display lldp neighbor-information list |
display interface brief |
display interface {if} |
Community |
juniper |
juniper_junos |
show lldp neighbors |
show interfaces |
show interfaces {if} |
Community (rates often sparse) |
nokia |
alcatel_sros |
(stub / no SROS LLDP tpl) | show port |
show port {if} |
Community port status; AOS LLDP via alcatel_aos |
mikrotik |
mikrotik_routeros |
— | /interface print brief |
/interface print detail … |
Community; no LLDP path |
ericsson |
ericsson_ipos |
stub | — | — | No community LLDP/iface templates |
alcatel_aos device_type uses community show lldp remote-system (mapped to platform alcatel_aos).
Adding a template
- Put the file under the vendor folder, e.g.
zte/zte_zxros_show_xxx.textfsm - Name:
{platform}_{command_slug}.textfsm(same convention as ntc-templates) - Register in root
indexwith a relative path:zte/zte_zxros_show_xxx.textfsm, .*, zte_zxros, sh[[ow]] ... - Align Value names with community templates when possible
- If the CLI wraps the last column onto the next line, add a
CliWrapRuleinnetx_api/cli_wrap.py(platform + command scoped) — do not try to solve mid-token wraps in TextFSM alone - Add unit tests under
tests/
When community already works, no file is required. When community is wrong/incomplete for our lab, add an override under the vendor folder with the same Platform+Command so NetX wins.
Concurrency
Template files are read-only and safe across processes. Parsing goes through
netx_api.ntc_parse (wrap-join → fresh CliTable + process lock; never share instances across threads).