Blogs

How-To: Install Junos PyEZ correctly

By Erdem posted 04-24-2014 19:49

  

Overview

Basic remote connectivity and fact gathering.

 

Example


 

from pprint import pprint
from jnpr.junos import Device
dev = Device(host='my_host_or_ipaddr', user='jeremy', password='jeremy123' )
dev.open()
pprint( dev.facts )
dev.close()

 

Here is the sample output when connecting to an SRX210 device:

 

>>> pprint(dev.facts)
{'2RE': False, 'RE0': {'last_reboot_reason': '0x20:power-button soft power off', 'model': 'RE-SRX210H', 'status': 'OK', 'up_time': '10 minutes, 3 seconds'}, 'domain':'workflowsherpas.com'
'fqdn': 'srx210.workflowsherpas.com', 'hostname': 'srx210', 'ifd_style': 'CLASSIC', 'model': 'SRX210H','personality': 'SRX_BRANCH', 'serialnumber': 'AD2909AA0096', 'switch_style': 'VLAN', 'version': '12.1X44-D10.4', 'version_info': junos.versino_info(major=(12, 1), type=X, minor=(44, 'D', 10), build=4)}
 

 

Video

 


#How-To
#example
#junospyez
#Python
#video