thatmattlove / hyperglass

hyperglass is the network looking glass that tries to make the internet better.
https://hyperglass.dev
BSD 3-Clause Clear License
617 stars 93 forks source link

Juniper structured throwing error #273

Open astlaurent opened 1 month ago

astlaurent commented 1 month ago

Deployment Type

Docker

Version

v2.0.4

Steps to Reproduce

When using structured on Juniper for show bgp route I am getting back

rt, 0, rt_entry, 0, peerAs

When I set structured to false it works fine. (log attached)

Also I noticed that if I set structured as false I see 2 versions of BGP route in the drop down, one does the non xml command, one does the xml command. I assume that is a bug of some sort (image attached of that)

debug.txt

image

Expected Behavior

router to produce expected results

Observed Behavior

router did not product expected results

Configuration

org_name: redacted
plugins: []
primary_asn: redacted
request_timeout: 15
site_description: redacted Looking Glass
site_title: redacted Looking Glass

web:
    location_display_mode: dropdown
    text:
        title_mode: logo_only
    logo:
         light: /etc/hyperglass/static/custom/light.png
         dark: /etc/hyperglass/static/custom/dark.png
         favicon: /etc/hyperglass/static/custom/fav.png
         width: 50%
         height: null
    theme:
         default_color_mode: dark

structured:
    rpki:
        mode: external

Devices

- name: Router
    group: North Central
    address: x.x.1.100
    credential: *credential1
    platform: juniper_junos
    attrs: *attr1
    directives:
        - builtins: [bgp_route, traceroute, ping]

Logs

attached
astlaurent commented 1 month ago

looked into this error a bit more. It seems like on my Juniper installs the active route does not display the parameters for peer-as and local-as. It does show them for all the other inactive routes though. not sure what the fix would bee though. I am am not sure if this has to do with the fact we are using reflectors or if the the issue has to do with certain juniper code versions missing those parameters

astlaurent commented 1 month ago

Worked on this a bit tonight and did a workaround for now and it seems to work properly

edited the juniper parser within the docker container -vi /opt/hyperglass/hyperglass/parsing/juniper.py -change the following lines to look like the following peer_as: int = 0 source_as: int = OUR AS NUMBER -type in exit -Get docker container ID sudo docker ps -a copy container ID for hyperglass-hyperglass -commit docker changes sudo docker commit hyperglass-hyperglass -restart service