Automation

last person joined: 8 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  dev.open() doesn't work

    Posted 01-31-2017 17:34

    Hi,

     

    I am new to PyEZ and Linux.

     

    Just tried my first script using PyEZ and could not connect to the device using the dev.open().

     

    Device IP is reachable from the Linux machine and the netconf is also configured in the device.

     

    Please advice how to make it working.

     

    >>>>>>>

    >>> from jnpr.junos import Device
    >>> dev = Device(host="10.10.10.10", user="test", password="test123")
    >>> dev.open()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.7/site-packages/jnpr/junos/device.py", line 899, in open
        raise EzErrors.ConnectTimeoutError(self)
    jnpr.junos.exception.ConnectTimeoutError: ConnectTimeoutError(10.10.10.10)
    >>>

     



  • 2.  RE: dev.open() doesn't work
    Best Answer

     
    Posted 01-31-2017 18:58

    Hi,

     

    Can you hit tcp port 830 from the host that you are running the py script?

     

    If SSH works from your client you can add port=22 to the open() command to use that port instead of 830.

     

    Tim



  • 3.  RE: dev.open() doesn't work

    Posted 01-31-2017 19:14

    Thanks Tim.

     

    it works after i pass port = 22. So, the dev.open() by default uses tcp port 830 and not 22.

     



  • 4.  RE: dev.open() doesn't work

     
    Posted 01-31-2017 19:51

    Yes that is correct.

     

    Check out the API here, it details the default settings 

     

    Tim



  • 5.  RE: dev.open() doesn't work

    Posted 02-08-2017 14:13

    How do you pass port 22 in the dev.open() command?



  • 6.  RE: dev.open() doesn't work

     
    Posted 02-08-2017 14:29

    Device(host, user, password, port=22).open()