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

request support information fails as an RPC and cli() call #87

Closed
supertylerc opened this issue Jan 23, 2014 · 5 comments
Closed

request support information fails as an RPC and cli() call #87

supertylerc opened this issue Jan 23, 2014 · 5 comments
Assignees

Comments

@supertylerc
Copy link

When using the version from pip, it is not possible to run request support information via the cli() method or an on-demand RPC call.

Steps to reproduce:

  1. Establish a NetConf session with a router
  2. Use the cli() method to gather request support information
  3. Use the on-demand RPC method to gather request support information.

This was tested on an MX80 running Junos 11.4R7.5. There is example output below.

>>> from jnpr.junos import Device
>>> rtr = Device(user='tyler', host='1.1.1.1', password='xxxxxx')
>>> rtr.open()
Device(1.1.1.1)
>>> rtr.cli("request support information")
'invalid command: request support information'
>>> rtr.rpc.request_support_information()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/junos_eznc-0.0.2-py2.7.egg/jnpr/junos/rpcmeta.py", line 121, in _exec_rpc
    return self._junos.execute(rpc)
  File "/usr/local/lib/python2.7/dist-packages/junos_eznc-0.0.2-py2.7.egg/jnpr/junos/device.py", line 257, in execute
    raise RpcError(cmd=rpc_cmd_e, rsp=rsp)
jnpr.junos.exception.RpcError
>>> from pprint import pprint
>>> pprint(rtr.facts)
{'2RE': False,
 'RE0': {'last_reboot_reason': 'Router rebooted after a normal shutdown.',
         'model': 'RE-MX80-T',
         'status': 'OK',
         'up_time': '299 days, 7 hours, 15 minutes, 26 seconds'},
 'fqdn': 'xxxx',
 'hostname': 'xxxx',
 'ifd_style': 'CLASSIC',
 'model': 'MX80-T',
 'personality': 'MX',
 'serialnumber': 'T3427',
 'switch_style': 'BRIDGE_DOMAIN',
 'version': '11.4R7.5',
 'version_info': junos.version_info(major=(11, 4), type=R, minor=7, build=5)}
>>>
@supertylerc
Copy link
Author

After uninstalling the pip version of py-junos-eznc and grabbing the current build from GitHub, this issue still exists.

@ghost ghost assigned jeremyschulman Jan 23, 2014
@jeremyschulman
Copy link
Contributor

@tyler-c - thank you for raising this issue. I will look into this. I also think this functionality should be included directly into the main library so folks can either get access to the text or save it to file. I'll give it some thought about putting it in one of the 'jnpr.junos.utils' files or something along those lines.

@jeremyschulman
Copy link
Contributor

Here is what I did after I connected a dev (python shell)

>>> dev.timeout = 60*60
>>> sup_info = dev.rpc.get_support_information()
>>> print sup_info.text

I tested this on an MX running:

>>> dev.facts['version']
'12.3R4.6'

Please see if those steps work for you. If not, I will downgrade my MX to match your version and retest.

@jeremyschulman
Copy link
Contributor

Here is how I knew the specific 'rpc':

jschulman@MX> request support information | display xml rpc 
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.3R4/junos">
    <rpc>
        <get-support-information>
        </get-support-information>
    </rpc>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>

@supertylerc
Copy link
Author

@jeremyschulman

looks like this was the secret--the proper command is get-support-information instead of request-support-information.

Sorry for raising the issue, and thanks for the assist. :)

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

No branches or pull requests

3 participants