Questions tagged [pyez]

Junos PyEZ is a Python library to remotely manage/automate Junos devices via SSH/Telnet/Serial connections.

Junos PyEZ is designed to provide the same capabilities as a user would have on the Junos CLI, but in an environment built for automation tasks. These capabilities include, but are not limited to:

  • Remote connectivity and management of Junos devices via NETCONF
  • Provide "facts" about the device such as software-version, serial-number, etc.
  • Retrieve "operational" or "run-state" or "configuration" information as Tables/Views
  • Make configuration changes in unstructured and structured ways
  • Provide common utilities for tasks such as secure copy of files and software updates

readthedocs: http://junos-pyez.readthedocs.io/en/latest/index.html

github: https://github.com/Juniper/py-junos-eznc

videos: https://www.youtube.com/results?search_query=PyEZ

35 questions
4
votes
2 answers

Executing vty commands in Juniper routers using PyEZ

I have a requirement where, a python script running in a Juniper router shell needs to execute some commands in vty console of the FPC. I cannot use vty ­c because it may not work properly in all platforms. However, I can use vty fpc0 and then…
Ghost
  • 3,966
  • 1
  • 25
  • 36
3
votes
2 answers

Junos PyEZ Entering Passwords from Python

Hi I am currently learning PyEZ to configure JunOS devices from Python. But I am stuck at a certain problem. I want to be able to create new users through Python but I can't figure out how to enter passwords with python. I have tried many different…
2
votes
0 answers

JunOS pyEz - Using 'serial' mode with Device class throws exceptions

I have been trying to use JunOS pyEZ to provision SRX which needs serial connection for initial configuration. Using the below mentioned code throws I/O exception: from jnpr.junos import Device from jnpr.junos.utils.config import Config import…
shivintwrk
  • 21
  • 1
2
votes
1 answer

PyEZ: RPC: Get route info for specific grandchild element

I want to get wia RPC info like this: > show route output interface ae40.4181 | display xml rpc
brownian
  • 435
  • 3
  • 13
2
votes
2 answers

Unable to make a PyEZ connection: ConnectUnknownHostError

I am trying to use juniper_junos_facts from the Ansible Junos module to query some VM's that I provisioned using Vagrant. However I am getting the following error. fatal: [r1]: FAILED! => {"changed": false, "msg": "Unable to make a PyEZ connection:…
Barry Keegan
  • 81
  • 2
  • 9
1
vote
1 answer

Using textFSM to parse multiple show commands

I'm trying to use textFSM to compile some Juniper "show" command outputs and get specific fields from them and finally printing collected info in one run. This is my code: import textfsm import getpass from netmiko import ConnectHandler from…
1
vote
2 answers

Beginner Python Script to ssh into remote network device and run multiple commands

Please pardon me as I am a very new to any programming language. I have around 25 network devices combination of cisco, juniper, linux etc which i need to remotely access and run some basic cli commands to get the output. Individually SSHing in to…
1
vote
0 answers

Getting Conditional Data Using PyEZ Tables

I'm trying to create a custom table/view for Junos interfaces. Yes, I know it already exists as a built-in/default table but this is a learning exercise that I plan to expand on later. The problem is that I want to only grab the inet family address,…
Chris Jones
  • 129
  • 8
1
vote
1 answer

juniper_junos_software installs software but task fails due to "No handlers.."

Im trying to install 12.3X48-D70 on an SRX550 using the juniper_junos_software module, and while it successfully installs and reboots the device the task returns as failed because of a "No handlers" errors. Playbook: - name: Upgrade Juniper devices …
1
vote
1 answer

How to install Juniper.junos ansible-galaxy in mac?

I tried to install the latest version of Juniper.junos on my Mac : sudo ansible-galaxy install Juniper.junos -downloading role 'junos', owned by Juniper -downloading role from…
1
vote
1 answer

Ansible 2.3 Core module junos_config - Failed "unable to open shell"

With Ansible 2.3 for the Core modules junos_config we get error "unable to open shell". My playbook 25 tasks: 26 - name: Build configuration 27 template: src={{ playbook_dir }}/bgp.j2 dest={{ build }}/{{…
Nitin Kr
  • 521
  • 2
  • 12
1
vote
2 answers

JUNOS PYEZ: Over write the Base config of a Device in SET command

I am writing the below code to push the base config to my device. But it is merging the lines and not over writing. Merging is still keeping the not required lines of Base config which is a problem to me My config is in set command format . Can…
1
vote
1 answer

PYEZ - Display set | Match command

I have been trying to run the below commands through below program but they are fetching the whole of config file and not the result of match command . Is match function not supported through PYEZ? show configuration | display set | match RI- show…
1
vote
2 answers

PyEZ: 'EntryPoint' object has no attribute 'resolve'

PyEZ user are facing issue with respect to subject line error from jnpr.junos import Device >>> dev = Device(host='xxx',user='xxxx',passwd='xxx') >>> dev.open() No handlers could be found for logger "ncclient.transport.ssh" Traceback (most recent…
Nitin Kr
  • 521
  • 2
  • 12
0
votes
0 answers

Issue with django crontabs there not working

hello guys i trying to use django_crontab on my django project and there not working does anyone know something about this im using Linux centos 8. I want to schedule a task to add some data to my database. Can someone help me The steps that i have…
1
2 3