labuser@saltsackmaster:~/project/python_script$ more get_facts.py
from jnpr.junos import Device
from pprint import pprint
junos_hosts = [ '172.30.95.177' ]
# junos_hosts = ['172.30.92.204','172.30.92.213']
for ip in junos_hosts:
# dev = Device(host=ip, user='root', password='eyeno1t2!')
dev = Device(host=ip, user='Netbox', password='Netbox')
dev.open()
pprint(dev.facts)
print("\nJLK: version :",dev.facts['version'])
dev.close()
|