Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netconf rpc - add as feature #190

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Conversation

lethalwp
Copy link
Contributor

This adds the netconf-rpc as a feature, and adds the xml query to every module.
It shouldn't change a thing for the ssh-cli.

After a lot of analyzing, on EX2200 my biggest performance issue came from the inner SSH Sessions being opened per request. The speed improvement with netconf comes mainly from the fact that i could keep the netconf session up.

The obvious solution is to change the ssh by netconf, and execute the commands directly in xml-rpc which seems to be native to juniper, and produces (almost) exactly the same output without the cli overhead.

Almost because there are lots of unnecessary "\n" in the interfaces xml replies.

To activate netconf on your device: (you also can run ssh+netconf on the same port 22)
set system services netconf ssh port 830

To find your show command in xml:
show command | display xml rpc

@Nothing4You
Copy link
Contributor

after investigating some performance issues related to this exporter i'm surprised to see this being an open PR for such a long time.

@czerwonk would there be interest in merging a working version of this compatible with the current version of the exporter?

this is about a 10x execution time difference (3.5s vs 0.35s) for simple tasks like only routing engine aginst a srx340 with an ssh session already established.

especially with "cheap" metrics being collected, it wouldn't surprise me if this amounted for a significant portion of the load we're seeing from the exporter.

@Nothing4You
Copy link
Contributor

this PR relies on github.com/Juniper/go-netconf, which is basically unmaintained and the original author doesn't recommend using it anymore.

instead, https://github.com/nemith/netconf is recommended as alternative, however, it currently advertises itself as "pre-alpha quality"

@nemith
Copy link

nemith commented Mar 5, 2024

instead, https://github.com/nemith/netconf is recommended as alternative, however, it currently advertises itself as "pre-alpha quality"

It's better quality than the original one and we are using it in prod. The only thing is that there may be breaking API changes and some bugs (true for any import).

Let me know what you need and I can help.

@nemith
Copy link

nemith commented Mar 5, 2024

But netconf is also poorly implemented and poorly supported on Junos too ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants