thatmattlove / hyperglass

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

devices.yaml - multiple Juniper devices bug #125

Closed erickhuge closed 3 years ago

erickhuge commented 3 years ago

Dears,

I'm trying to set-up the devices.yaml to connect with multiple PoPs using Juniper MX Routers, however, the first device works well, but in the second I see the netmiko are using something like Cisco syntax.

cat devices.yaml routers:

Miami

[INFO] 20210305 19:23:33 | scrapli.driver.async_driver:100 | open → Opening connection to saopaulobr [INFO] 20210305 19:23:35 | scrapli.driver.base_network_driver:318 | _pre_acquire_priv → Attempting to acquire exec privilege level [INFO] 20210305 19:23:35 | scrapli.driver.base_network_driver:355 | _process_acquire_priv → Acquired requested privilege level exec

In the first router, same model and version, works fine. In the second, we'see a cisco syntax but without response.

erickhuge commented 3 years ago

Hello,

After some tests, we found a issue between Junos 18.2R3.4 and Scrapli.

Solved the problem when used version v0 and using Netmiko.

thatmattlove commented 3 years ago

Hello,

Sorry for the delay, I was traveling for work and then took some extra time off afterward, but now I'm starting to catch up!

I'm having trouble understanding and reproducing this. I have two Juniper routers in my day job's production network, MX204s, one on 18.2R3.4, the other on 19.4.R3.11, and I'm able to query both from hyperglass just fine. The only difference I see in your configuration vs. mine is that you're using juniper_junos as the NOS, and I'm using juniper. However, this shouldn't matter as juniper_junos gets remapped automatically to juniper here.

Do you see any different behavior if you set yours to just juniper? Do you see this issue if you only have one router defined, or does it only happen when you have more than one?

You mention seeing Cisco syntax - can you elaborate? If you're referring to the Attempting to acquire exec privilege level message, I believe this is a normal Scrapli message that appears regardless of NOS (I see the same message in my working Juniper logs).

erickhuge commented 3 years ago

Hello,

Same behavior even if I set to "juniper" or "juniper_junos".

In my test, I have two Routers (one in Miami - and one in Sao Paulo (BR), same model)

Miami node works fine, Sao Paulo don't work, even if "SP" router are the only defined in the devices.yaml.

Attached one log for Sao Paulo, and one log file for Miami.

INFO: We're able to connect to the "problem" router through SSH, same credentials, with same command.

SAO PAULO Firmware: 18.2R3.4 MIAMI Firmware: 18.2R3-S5.3

miami.txt

saopaulo.txt

thatmattlove commented 3 years ago

This is very odd, and I can't seem to reproduce or make sense of it. That said, v1.0.0-beta.82 — which should be available shortly — has upgraded almost all dependencies to their latest versions (Scrapli included). Can you give it a try? If that doesn't work, beta 82 also adds a new option on the device model that allows you to override the driver. For example, you could set driver: netmiko to force hyperglass to use Netmiko to connect to the devices instead of Scrapli. Could you try that as well and see if you see any difference?

erickhuge commented 3 years ago

Yeah, very odd... But I have good news: worked like a charm with "driver: netmiko" :-D

thatmattlove commented 3 years ago

Hey, I'll take it!