Comments (6)
Hey @bpchoi ,
Flag no_qos_marking
was developed specifically for this purpose. Try to amend the XPath /interfaces/interface[name=et-0/1/11]
to be /interfaces/interface[name=et-0/1/11]/state
and give it a go (--no_qos_marking
shall be maintained)
Best,
Anton
from pygnmi.
Hi Anton,
This is what I got from device for capability.
{ 'gnmi_version': '0.7.0',
'supported_encodings': ['ascii', 'json_ietf'],
'supported_models': [ { 'name': 'junos-rpc-auto-bandwidth',
'organization': 'Juniper Networks, Inc.',
'version': '2019-01-01'},
...
In case of json_ietf encoding,
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = " Encoding 4 not supported, Only PROTO/JSON encoding supported"
debug_error_string = "UNKNOWN:Error received from peer ipv4:10.48.49.231:32767 {created_time:"2023-07-24T19:17:44.613652547+00:00", grpc_status:12, grpc_message:" Encoding 4 not supported, Only PROTO/JSON encoding supported"}"
With same device, other client like 'gnmic' works well.
I'm not quite sure why you think Juniper telemetry implementation is 'not ideal'.
Would you elaborate more?
Thank you,
Phil
from pygnmi.
Hi Anton,
With your suggested way, still no date is received same as before.
$ pygnmicli -t 10.48.49.231:32767 snip --insecure -e json -o subscribe-stream -x /interfaces/interface[name=et-0/1/11]/state --no-qos-marking
Collecting Capabilities...
Collection of Capabilities is successfull
Collecting Capabilities...
Collection of Capabilities is successfull
{
"update": {},
"sync_response": true
}
^CTelemtry collection is temrinated.
Exception in thread Thread-5 (enqueue_updates):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/bpchoi/venv/lib/python3.10/site-packages/pygnmi/client.py", line 972, in enqueue_updates
for update in subscription:
File "/home/bpchoi/venv/lib/python3.10/site-packages/grpc/_channel.py", line 475, in next
return self._next()
File "/home/bpchoi/venv/lib/python3.10/site-packages/grpc/_channel.py", line 881, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.CANCELLED
details = "Channel closed!"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Channel closed!", grpc_status:1, created_time:"2023-07-24T13:42:47.815601706-07:00"}"
Thank you,
Phil
from pygnmi.
Add /counters
. here is the working code for Juniper:
import os
import sys
from pygnmi.client import gNMIclient
# Statics
DEVICES = {
"juniper": {
"host": "hostname-juniper-router",
"port": "32767",
"message": {
"subscription": [
{
"path": "/openconfig-interfaces:interfaces/interface/state/counters",
"mode": "sample",
"sample_interval": 3000000000,
}
],
"mode": "stream",
"encoding": "proto",
},
"get": ['/openconfig-interfaces:interfaces/interface/config']
},
}
# Functions
def get_device() -> dict:
if len(sys.argv) != 2:
raise ValueError("You haven't specified device type.")
elif sys.argv[1] not in DEVICES.keys():
raise ValueError("Unsupported device type.")
else:
return DEVICES[sys.argv[1]]
# Body
if __name__ == "__main__":
creds = (os.getenv("AUTOMATION_USERNAME"), os.getenv("AUTOMATION_PASSWORD"))
dut = get_device()
with gNMIclient(
target=(dut["host"], dut["port"]),
username=creds[0],
password=creds[1],
insecure=True,
debug=False,
no_qos_marking=True,
) as gconn:
r1 = gconn.capabilities()
print(r1)
for item in gconn.subscribe2(subscribe=dut["message"]):
print(item)
from pygnmi.
Hi Anton,
I could subscribe using pygnmicli tool with 'no-qos-marking' flag on and update path with your kind info.
How can I do the same with nornir_pygnmi plugin with making 'no-qos-marking' flag to nornir task, gnmi_subscribe?
Thanks,
Phil
from pygnmi.
Hey @bpchoi,
Check out our documentation: https://github.com/akarneliuk/nornir_pygnmi/blob/main/examples/04_example_gnmi_subscribe.md
You can pass extra variables, (e.g., no_qos_verify
) in nornir connection_options
: https://github.com/akarneliuk/nornir_pygnmi/blob/main/examples/inventory/hosts.yaml#L9
from pygnmi.
Related Issues (20)
- 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
- 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
- Create a new release HOT 1
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.