Giter VIP home page Giter VIP logo

Comments (10)

scottdware avatar scottdware commented on July 30, 2024

It might be a bug. Thanks for catching this and I'll take a look at it!

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

Actually, I see the problem. You have the parameters backwards. The "section" is supposed to be the second (optional) parameter. If you just specify the following:

config, err := jnpr.GetConfig("text")

Then you will get the entire config, vs something like:

config, err := jnpr.GetConfig("text", "interfaces")

I will have to work on the MX parsing, as it's not coming through as it should. Everything else should work ok - I tested it on a QFX, EX, and SRX.

from go-junos.

radcool avatar radcool commented on July 30, 2024

OK, I think I know what might have happened. I stumbled upon your library from this blog entry. One of the examples on the page is the following:

routing, _ := jnpr.GetConfig("routing-instances", "text")  
fmt.Println(routing)

I just used that example as a start for my program and didn't double check with the GoDoc documentation. The RPC error returned wasn't obviously clear (to me), so it didn't dawn on me to double-check the docs to make sure I was using the function correctly.

Switching the argument order in my function call made it work, as you explained. Thanks for looking into it!

Do you need me to test anything with an MX?

Thanks,
-Martin

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

Ah...forgot to update my blog when I changed the function parameters around :) Thanks a lot!

Yeah, if you wouldn't mind testing, that would be great. I spent just a couple minutes diving into it yesterday, and apparently the XML response on the "get-software-information" RPC call is different than that of the other platforms.

from go-junos.

radcool avatar radcool commented on July 30, 2024

I tested using routing, err := jnpr.GetConfig("text") on an MX960 running 14.1R4.10 and was able to retrieve the config without any error. XML format retrieval also worked fine.

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

Do you have dual routing engines?

from go-junos.

radcool avatar radcool commented on July 30, 2024

Yes.

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

I'm running 14.2R5.8 on our MX104's and get an error. Must be tied to the model. I'll dig into it more. Thanks for the continued effort!

from go-junos.

radcool avatar radcool commented on July 30, 2024

My pleasure!

from go-junos.

daemus avatar daemus commented on July 30, 2024

@scottdware if you can provide me with the sanitized XML output of the equivalent SSH command, and the error you get from go-junos, I can try to fix it. I don't have access to any dual-RE MX gear, though.

from go-junos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.