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
PoC for piping the raw CLI output #617
Conversation
Autobot: Would an admin like to run functional tests? |
@jnpr-community-netdev are you sure this library is still maintained? :P Seriously now: @vnitinv @stacywsmith any thoughts on this one-month-old PR? |
@mirceaulinic Sorry for late response. Was on PTO for whole Nov. We are evaluating option to have support for pipe '|' over netconf from backend itself. Supporting cli kind of output by PyEZ will be a big burden, as with different device types output keeps changing. I hope you do understand. |
Hi @vnitinv - thanks for looking into this!
Sure, I understand, no problem; happy to close this PR if anything better in place.
That's very good news! It makes much more sense to be like that, however I have two questions:
Cheers! |
@vnitinv is this still on your radar? My hunch is that the solution you have exposed will never be available in older releases, most probably it will require Junos >= 16 or even >=17, which is not a comfortable constraint given that we are able to provide a workaround, without breaking the existing behaviour. This feature is based on the feedback of many engineers working in production environments. I know the theory, but, as always, in the real-world there are more specific needs. And filtering the output is one of them. @stacywsmith may I have also your input on this? Thanks, |
Can one of the admins verify this patch? |
@mirceaulinic this was more than a year ago. Are you still willing to finish this patch? |
Hi @attila123 - I think I'm waiting here for feedback from the maintainers... is Juniper still against doing this thing? |
Hi, |
Looks like only "| display xml rpc" piping is supported, see 'cli' method documentation at py-junos-eznc/lib/jnpr/junos/device.py Lines 661 to 680 in 5b6c3a1
|
A year late, but I am personally opposed to this as programmatically invoking CLI is anti-pattern when there are other mechanisms to retrieve and parse the data within the NETCONF system itself. What I mean is that the CLI simply passes a NETCONF command, and any piping is doing some processing prior to returning the data to the user. All in all, passing CLI over NETCONF is a bit of a hack, even if it is used a lot. However, this is just my 2c and I don't represent all of Juniper or even this project. :-) |
@ntwrkguru In our use case this cli can be executed remotely by operations people in troubleshooting situations. This is exactly what the cli is meant to be used for: debugging, troubleshooting. But currently cli is there, but in a crippled version, which limits the possibilities by not allowing most piping options. Looks like now I need to implement my own cli client with direct ssh (e.g. with paramiko library). |
And one layer down, mgd actually converts CLI to RPC on the box as well. :-) To your point, this is the pain of cultural transformation from a box-driven paradigm to an automated one. |
Based on the above discussions, the rpc based approach doesn't sync well with the cli pipe based implementation. |
Opening this PR for discussion around piping raw CLI outputs #616
Implemented only match and count so far. In case the model proposed looks good, we can move on and implement the others:
Of course, except things such as no-more, as anyway it is provided the complete output, or refresh.