-
Notifications
You must be signed in to change notification settings - Fork 83
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
base: main
Are you sure you want to change the base?
Conversation
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. |
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" |
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. |
But netconf is also poorly implemented and poorly supported on Junos too ;) |
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