Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [pyez]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
61 views

Unable to use jnpr.junos device library to open a device conection

Hi I getting this type of errors, File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/jnpr/junos/device.py", line 1374, in open self._conn = netconf_ssh....
Carlos Castillo's user avatar
0 votes
1 answer
58 views

PyEZ - Getting RpcTimeoutError after succesful commit even though timeout value is set to a high value

I've got a Python (3.10) script using the PyEZ library to connect to Junos devices and commit various display set commands. Although both these steps are successful, when having committed the ...
Beeelze's user avatar
  • 503
1 vote
1 answer
855 views

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 ...
Adam Freemotion's user avatar
0 votes
1 answer
285 views

Juniper PyEZ ephemeral database send RPC

I want to send some "raw" RPC commands For example; <rpc> <open-configuration> <ephemeral-instance>eph1</ephemeral-instance> </open-configuration> </rpc> ]...
Neil Bernard's user avatar
2 votes
0 answers
237 views

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 ...
shivintwrk's user avatar
2 votes
1 answer
619 views

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 <rpc-reply xmlns:junos="http://xml.juniper.net/junos/17.4R2/junos"> <rpc> &...
brownian's user avatar
  • 425
0 votes
1 answer
275 views

JSNAPY: Is there a way to test on xpath node attributes

I am trying to determine how to test on the node attributes that junos occasionally uses. In this particular case, I want to find all BGP sessions that are down between 20w and 1y. The seconds value ...
aelliott's user avatar
0 votes
2 answers
308 views

Using PyEZ on EX4300

Does PyEZ work with an EX4300 switch? Looking https://www.juniper.net/documentation/en_US/junos/topics/concept/rest-api-overview.html under the Platform and Release Support link, it appears that EX ...
Daniel Pasono's user avatar
0 votes
1 answer
252 views

How to extract BGP configuration of specific group?

How to extract junos mx bgp configuration of specific group using pyez configuration tables? i have tried using the following table/view: BGPConfigTable: get: groups/protocols/bgp/group/neighbor ...
Yair G's user avatar
  • 1
2 votes
2 answers
3k views

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! => {"...
Barry Keegan's user avatar
0 votes
1 answer
885 views

How to verify outputs of line code in a python function

I have test a function below and how can I verify the output of specific line in the function below. def data(): dev = Device(host="1.1.1.1", user="test", password="test123", port=22, ...
chenoi's user avatar
  • 575
1 vote
2 answers
2k views

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 ...
Rutvij Brahmbhatt's user avatar
0 votes
3 answers
5k views

Is there a way to convert juniper "json" or "xml" config to "set" or "show" config?

We use juniper hardware with junos version 15. In this version we can export our config as "json" or "xml" which we want to use to edit it with our automation tooling. Importing however is only ...
XenGi's user avatar
  • 166
1 vote
0 answers
219 views

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 ...
Chris Jones's user avatar
-1 votes
1 answer
75 views

xml print element values with python

I am testing pyez with rpc calls to get a mac-table, so far i am able to pull the data but when i print this data doesn´t show me the values it shows me only memory addresses. below my code: dev = ...
Gabriel Flores's user avatar
0 votes
2 answers
1k views

How do I get the mac-address table of a Juniper router using PyEZ? It throws an error when running

I have created a simple python script to get the vpls mac table from a rouer using an RPC command. Hower it throws an error when running. Does anybody know what I am doing wrong? root@ubuntu:~# cat ...
Daniel Boirivant's user avatar
0 votes
2 answers
368 views

Junos Device CLI command giving wrong output when executed from python

When i try to execute Device.cli(....) command from python it gives me wrong output. What could be the issue? For example, if i execute below command on directly on Juniper Device CLI, it gives the ...
Srikanth Hugar's user avatar
1 vote
1 answer
455 views

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" ...
Kyle Quilliam's user avatar
0 votes
2 answers
1k views

Load Configuration File with Juniper PyEZ

I am trying to load override a config stored on the juniper device (vSRX) with PyEZ. The code looks like this from jnpr.junos import Device from jnpr.junos.utils.config import Config dev = Device(...
gh0st's user avatar
  • 432
-2 votes
1 answer
334 views

fatal: [cor-001]: FAILED! => {"changed": false, "msg": "junos-eznc (aka PyEZ) >= 2.1.7 is required for this module. However, junos-eznc does not a

I am getting this error when trying to run my playbook even though I have already installed pyEZ. Can anyone please help me to fix it? MCBOOK:~ user2018$ ansible-playbook simpletest.yml [...
farhad's user avatar
  • 1
0 votes
1 answer
478 views

get_bgp_summary_information RPC and using logical-systems

Hi I am trying to use PyEZ to to create an automation script. My goal is save response from bgp summary with logical system in a variable This one works: bgpinfo= cor1.rpc....
farhad's user avatar
  • 1
1 vote
1 answer
886 views

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 https://github....
dinesh babu's user avatar
0 votes
1 answer
542 views

pyEZ : how to get junos default groups

I am working on a project to automate junos firewall policy creation workflow. I found pyEZ as the most viable option for my case. Although I am able to retrieve the complete configuration from the ...
Prabir's user avatar
  • 11
1 vote
1 answer
786 views

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={{ ...
Nitin Kr's user avatar
  • 531
1 vote
2 answers
705 views

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 ...
Aryashree Mohapatra's user avatar
1 vote
1 answer
2k views

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? ...
Aryashree Mohapatra's user avatar
0 votes
1 answer
167 views

PyEZ - Cron Job to connect to 8 routers and save the running config to 8 local files at a specific time stamp

I am a starter to PyEZ. Can I write a cron job in PyEZ which will connect to 8 routers and fetch the running Config on device and save to 8 different files at a particular timestamp. Could you help me ...
Aryashree Mohapatra's user avatar
0 votes
2 answers
730 views

Is is possible to add/edit prefix list and policy statement using pyez

Is it possible to edit the prefix list and policy statements through pyez in juniper router. Device details junos version : 15.1f5, Device : juniper mx240 And i am using pyez on top of netconf to ...
Siva Gnanam's user avatar
0 votes
1 answer
1k views

How to use Junos PyEZ configuration table to extract all interface units?

I was trying to use PyEZ InterfaceTable to extract interface configuration. My problem is that I can only see one unit per interface while there are actually more than one configured on some ...
Peter K's user avatar
  • 11
0 votes
2 answers
745 views

How to make Junos PyEZ work via console port?

I am trying to make Junos PyEZ work via console port (telnet to a Cisco AS2511-RJ terminal server, which is connected to Juniper SRX-240 console port). The test script is dev = Device(host='X.X.X.X'...
Peter K's user avatar
  • 11
4 votes
2 answers
3k views

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 ...
Ghost's user avatar
  • 3,966
-1 votes
1 answer
1k views

PyEZ: jnpr.junos.exception.ConnectRefusedError: ConnectRefusedError(xx.xxx.xxx.xxx)

PyEZ Device connection returns ConnectRefusedError. >>> dev = Device(host='xx.xxx.xx.xx', user='xxxx',password='xxxx') >>> dev.open() Traceback (most recent call last): File "<...
Nitin Kr's user avatar
  • 531
1 vote
2 answers
1k views

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 ...
Nitin Kr's user avatar
  • 531
0 votes
2 answers
1k views

Python - change password for user in JunOS

I need assistance with this project and issues im having. I am able to make changes to this juniper router with no issues.. The issue comes in when I need to change the password for a user. Per the ...
D' go's user avatar
  • 21
3 votes
2 answers
1k views

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 ...
Oscar Deniz Jensen's user avatar