Repository navigation
Closed
Labels
possible-bugSomething isn't workingSomething isn't working
Description
Bug Description
Hi! I'm running the latest hyperglass server and it connects to a VMX with Junos 19.4R1-S2.2. It fails to parse the XML response
Expected behavior
I expect to see route information
Steps to Reproduce
I'm not a network engineer so I cannot really tell you how to setup our MX to get the same routing information 😢
Local Configurations
my devices.yaml
---
routers:
- name: vmx-1
address: rfc1918ip
network:
name: primary
display_name: lab
credential:
username: hyperglass
password: foobar
display_name: vmx-1
port: 22
nos: juniper
proxy: null
vrfs:
- name: default
display_name: default
ipv4:
source_address: rfc1918ip
force_cidr: falsebased on the docs it's not really clear what's the difference between juniper and juniper_junos for the nos attribute. I assume juniper is correct here because the created command works in the CLI. If I specify juniper_junos I get an error about missing commands.
Logs
all the logs \o/
juniper version:
> show version | match Junos:
Junos: 19.4R1-S2.2
command send from hyperglass to VMX:
Sep 18 18:18:21 hyperglass python3[20985]: [DEBUG] 20200918 18:18:21 | hyperglass.execution.drivers.ssh_scrapli:97 | collect → Raw response for command "show route protocol bgp table inet.0 *hiddenip* detail | display xml":
output if I execute this on the VMX:
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/19.4R0/junos">
<route-information xmlns="http://xml.juniper.net/junos/19.4R0/junos-routing">
<route-table>
<table-name>inet.0</table-name>
<destination-count>32086</destination-count>
<total-route-count>32147</total-route-count>
<active-route-count>32086</active-route-count>
<holddown-route-count>0</holddown-route-count>
<hidden-route-count>0</hidden-route-count>
<rt junos:style="detail">
<rt-destination>*hidden*</rt-destination>
<rt-prefix-length>32</rt-prefix-length>
<rt-entry-count junos:format="1 entry">1</rt-entry-count>
<rt-announced-count>1</rt-announced-count>
<rt-entry>
<active-tag>*</active-tag>
<current-active/>
<last-active/>
<protocol-name>BGP</protocol-name>
<preference>170</preference>
<preference2>-101</preference2>
<nh-type>Indirect</nh-type>
<nh-index>0</nh-index>
<nh-address>0x104b4d88</nh-address>
<nh-reference-count>9</nh-reference-count>
<nh-kernel-id>0</nh-kernel-id>
<gateway>*hidden*</gateway>
<protocol-nh junos:indent="16">
<to>*hidden*</to>
<indirect-nh>0x2 no-forward INH Session ID: 0x0
</indirect-nh>
</protocol-nh>
<rt-entry-state>Active NotInstall Ext</rt-entry-state>
<local-as>*hidden*</local-as>
<peer-as>*hidden*</peer-as>
<age junos:seconds="980918">1w4d 8:28:38</age>
<metric2>0</metric2>
<validation-state>unverified</validation-state>
<task-name>BGP_*hidden*+49306</task-name>
<announce-bits>1</announce-bits>
<announce-tasks>4-BGP_RT_Background </announce-tasks>
<as-path>AS path: *hidden* I
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>AS path: </aspath-effective-string>
<attr-value>*hidden* I</attr-value>
</attr-as-path-effective>
</bgp-path-attributes>
<bgp-rt-flag>Accepted</bgp-rt-flag>
<local-preference>100</local-preference>
<peer-id>*hidden*</peer-id>
</rt-entry>
</rt>
</route-table>
</route-information>
<cli>
<banner></banner>
</cli>
</rpc-reply>error from the hyperglass log:
Sep 18 18:18:21 hyperglass python3[20985]: [CRITICAL] 20200918 18:18:21 | hyperglass.parsing.juniper:54 | parse_juniper → ''nh'' was not found in the response
Sep 18 18:18:21 hyperglass python3[20985]: [CRITICAL] 20200918 18:18:21 | hyperglass.exceptions:30 | __init__ → [DANGER] Error parsing response data
Possible Solution
Environment
Server
| Metric | Value |
|---|---|
| hyperglass Version | 1.0.0-beta.57 |
| hyperglass Path | /opt/hyperglass/hyperglass |
| Python Version | 3.6.8 |
| Platform Info | Linux-5.8.9-1.el7.elrepo.x86_64-x86_64-with-centos-7.8.2003-Core |
| CPU Info | Intel Xeon Processor (Skylake, IBRS) |
| Logical Cores | 4 |
| Physical Cores | 1 |
| Processor Speed | 2.095076GHz |
| Total Memory | 4.13 GB |
| Memory Utilization | 32.9% |
| Total Disk Space | 51.65 GB |
| Disk Utilization | 13.6% |
Metadata
Metadata
Assignees
Labels
possible-bugSomething isn't workingSomething isn't working
Activity
add support for juniper protocol-nh type, see #83
fischa commentedon Oct 5, 2020
@checktheroads have you considered using napalm for getting a standardized output for the "major" networking vendors? Parsing output even though it is XML can be painful if it changes over time. It looks like the readthedocs compatibility matrix (of napalm) is out of date as I can see the junos version of get_route_to() in the code.
thatmattlove commentedon Oct 5, 2020
I've considered it, but every time I look at it I'm unhappy with the options and consistency. For example, it doesn't appear you can do a BGP lookup based on community or AS_PATH, meaning I'd have to fall back to scraping & parsing for specific commands, for specific NOS. Why? I'm relatively happy with the Juniper parsing as it stands now (after pushing 9b87e5d). Now, for Cisco IOS/IOS-XR/NX-OS, I'm planning on looking at TTP for "reverse-template" style parsing.
@bastelfreak - can you confirm if 1.0.0-beta.58 fixes this issue?
bastelfreak commentedon Oct 5, 2020
thanks for the update, I will test it tomorrow morning.
bastelfreak commentedon Oct 9, 2020
hey. Sorry for the late response. I can confirm that the error is now fixed and
bgp routeoption works now fineforkwhilefork commentedon Oct 29, 2020
hey I'm having a similar problem (Junos parsing). Here's my log data:
It looks like it's choking on the
{master}line at the end.