Comments (8)
Hello @svautour ,
sorry for the delay, I somehow overlooked your request. I'm afraid you don't provide any details of your setup. Please, provide the configuration of your network device you try to manage with pygnmi
.
also, this part is not accurate:
if name == 'main':
It shall be:
if __name__ == "__main__":
Join our Zero-to-Hero Network Automation Training to learn more about Python for network automation
Best,
Anton
from pygnmi.
Hey @svautour ,
Please, re-open if needed.
Best,
Anton
from pygnmi.
Re-opening. Sorry for the delay, I was on vacation.
My code does have the underscore. It didn't come across correctly as I didn't paste it as a code block.
What information do you require that I did not include? What command outputs would you like?
The config on the router that I am trying to manage is irrelevant here as when I tcpdump the NIC on the server where I run the code, I see no outbound packets to my device on port 57400.
Thanks for creating and sharing. I am looking forward to a gnmi client for python. I will help if I can.
Serge
from pygnmi.
Hey @svautour ,
if pygnmi doesn't send anything to a wire, it may be something with your environment. Could you please suggest what is:
- Your OS and its version
- Your Python version
- Output of
pip freeze
Best,
Anton
from pygnmi.
Using a venv:
(virtual3.8) root@xxxxxx-ubuntu:~/TrainingExamples# python3 -V
Python 3.8.0
(virtual3.8) root@xxxxxx-ubuntu:~/TrainingExamples# python3 pygnmitest.py
Traceback (most recent call last):
File "pygnmitest.py", line 7, in
with gNMIclient(target=host, username="svautour", password="xxxxxxx", insecure=True) as gc:
File "/root/TrainingExamples/virtual3.8/lib/python3.8/site-packages/pygnmi/client.py", line 94, in enter
return self.connect()
File "/root/TrainingExamples/virtual3.8/lib/python3.8/site-packages/pygnmi/client.py", line 146, in connect
self.wait_for_connect(timeout)
File "/root/TrainingExamples/virtual3.8/lib/python3.8/site-packages/pygnmi/client.py", line 156, in wait_for_connect
grpc.channel_ready_future(self.__channel).result(timeout=timeout)
File "/root/TrainingExamples/virtual3.8/lib/python3.8/site-packages/grpc/_utilities.py", line 139, in result
self._block(timeout)
File "/root/TrainingExamples/virtual3.8/lib/python3.8/site-packages/grpc/_utilities.py", line 85, in _block
raise grpc.FutureTimeoutError()
grpc.FutureTimeoutError
(virtual3.8) root@xxxxxx-ubuntu:~/TrainingExamples# uname -a
Linux xxxxxx-ubuntu 4.15.0-167-generic #175-Ubuntu SMP Wed Jan 5 01:56:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
(virtual3.8) root@xxxxxx-ubuntu:~/TrainingExamples# more /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
(virtual3.8) root@COVEP23tools-ubuntu:~/TrainingExamples# pip3 freeze
cffi==1.15.0
cryptography==36.0.2
dictdiffer==0.9.0
grpcio==1.44.0
grpcio-tools==1.44.0
kthread==0.2.3
protobuf==3.20.0
pycparser==2.21
pygnmi==0.6.9
six==1.16.0
(virtual3.8) root@COVEP23tools-ubuntu:~/TrainingExamples# pip freeze
cffi==1.15.0
cryptography==36.0.2
dictdiffer==0.9.0
grpcio==1.44.0
grpcio-tools==1.44.0
kthread==0.2.3
protobuf==3.20.0
pycparser==2.21
pygnmi==0.6.9
six==1.16.0
Thanks,
Serge
from pygnmi.
Hey @svautour ,
Try to build a new VM and see how it would work. I've just tested this:
if __name__ == "__main__":
with gNMIclient(target=(ENV_HOSTNAME, ENV_PORT),
username=ENV_USERNAME,
password=ENV_PASSWORD,
insecure=True) as gconn:
gconn.capabilities()
result = gconn.get(path=["/"])
print(result)
and got:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked v1), capture size 262144 bytes
16:52:46.668450 IP 192.168.1.115.60630 > ***.***.***.***.57400: Flags [S], seq 2497241027, win 64240, options [mss 1460,sackOK,TS val 867433530 ecr 0,nop,wscale 7], length 0
16:52:46.672539 IP ***.***.***.***.57400 > 192.168.1.115.60630: Flags [S.], seq 1098571442, ack 2497241028, win 65160, options [mss 1460,sackOK,TS val 2456298786 ecr 867433530,nop,wscale 7], length 0
16:52:46.672583 IP 192.168.1.115.60630 > ***.***.***.***.57400: Flags [.], ack 1, win 502, options [nop,nop,TS val 867433534 ecr 2456298786], length 0
So it doesn't seem to be an issue with pygnmi, sir.
Best,
Anton
from pygnmi.
from pygnmi.
If this is against SR Linux (or perhaps some other device with security by default), try insecure=False
from pygnmi.
Related Issues (20)
- Logs to console HOT 1
- Diff action not showing add related changes
- Add option to hide prefix in the diff output HOT 1
- How to send set request with proto encoding? HOT 2
- FR: Add ability to set the auth scheme for targets HOT 3
- timeout or gnmi-timeout doesn't seem to work HOT 1
- subscribe not working to Juniper device HOT 6
- nornir example for subscribe stream mode HOT 1
- Missing minimum grpcio version in requirements HOT 1
- Invalid Path error HOT 4
- Release new version HOT 2
- Issue with pygnmi not returning value for get on leaf level for presence container HOT 2
- Feature: Distribute the whl file when publishing to pypi HOT 1
- Issue with Thread Termination in gNMI Client Subscription HOT 2
- Proper certificate usage with pygnmi HOT 3
- gNMI Master Arbitration Extension HOT 2
- pygnmi/pygnmic no longer working with Cisco IOS-XR 7.10.2 unified-model HOT 4
- PYGNMI commit replace is not replacing the running config . HOT 6
- Didn't find any infrastructure support to do master arbitration for performing Set operation HOT 1
- Support for "origin" field
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygnmi.