Closed LukeCage closed 3 years ago
Hi @LukeCage
dont mean to step on openconfig/gnmi
toes, but if you will exhaust your options with the reference client, I encourage you to try out the other client - https://gnmic.kmrd.dev - it uses openconfig/gnmi
as a backend lib.
It is heavily documented and your case should be solved easily with the cli flags
Thanks for your reply, @hellt ...
My problem is that I don't have super user privileges to install your app on the server, so I am committed (like it or not) to use this one. I would like to try yours though and hope to access a server that will allow me to do so.
Cheers.
you don't need sudo rights, you can download the binary manually from the releases, having only curl/wget https://github.com/karimra/gnmic/releases/tag/v0.4.1
I see you have SAMPLE in quotes in your text. An ENUM is not quoted in a text proto. Try adding
-proto "subscribe:<subscription:<path:<elem:<name:'openconfig-system:system> elem: <name: clock'> elem: <name: 'config'> elem: <name: 'timezone-name'>> mode: SAMPLE sample_interval: 5000000000>>"
leave the -timeout and -polling_interval off. -timeout will terminate before your second response and -polling_interval is for polling mode where client (the cli in this case) triggers the retrieval of data.
Not knowing what server you are using, but the yang module name should not appear in the gNMI path and the prefix< origin: "openconfig">> may need to be set.
On Thu, Oct 22, 2020 at 1:26 PM Luke Cage notifications@github.com wrote:
I am unable to subscribe to and collect streaming telemetry data from my remote devices. Can someone help me construct the command. An example of a command that works for "ON_CHANGE" (default?) based subscription mode is below:
-bash-4.2$ ./gnmi_cli -a 10.111.27.8:6702 -client_crt client_https_rsa40965.cert.pem -client_key client_https_rsa40965.key.pem -with_user_pass -dt s -client_types gnmi -insecure -updates_only -qt s -q /al:alarm-notification
According to github documentation, on-line, the command takes the following form:
gnmi_cli -address localhost:10161 -proto "subscribe:<mode: 0, prefix:<>, subscription:<mode:0, path: <elem: <name: 'openconfig-system:system'> elem: <name: 'clock' > elem: <name: 'config'> elem: <name: 'timezone-name'>>>>" -timeout 5s -alsologtostderr -polling_interval 5s -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt
So, it appears that I have to set the subscription mode (to "SAMPLE") via the -proto option. How would I do this? Every command I issued fails.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmi/issues/83, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEL4QL7V2OA5ULNXK7PA2PDSMBTMHANCNFSM4S3QAJ7A .
HI @gcsl ...
You example has 6 "<" and 7 ">" so I am not sure how they all match as one command.
Your open and closed quotes seem suspect to me also. So, it is hard for me to interpret accurately what you are trying to communicate to me.
Thanks,
Luke
Hi @hellt ,
I downloaded the compressed tar-ball and tried to run the gNMIc client but I got the following message:
-bash-4.2$ ./gnmic -a 10.111.22.194:6702 -u luke -p cage --insecure capabilities --log gnmic 2020/10/26 13:03:04.235019 failed to create a gRPC client for target '10.111.22.194:6702', timeout (10s) reached
Clearly, if a gRPC connection is not established between the client and server, gNMIc will not work. What do you think my problem might be here?
Thanks,
Luke.
@LukeCage can be many things, which are likely have to be with the gnmi target configution.
Things I'd have tried:
--debug
flag to see if any low-level log messages will be helpful.--insecure
flag in gnmic will not not use TLS setup). If target is configured to use TLS certs, than use --skip-verify
flag instead.Apologies. I was trying to merge a command I had used on one of my devices with the path you had supplied. The suggestion was focused around the two fields in the proto
mode: SAMPLE sample_interval: 5000000000
With no quotes and an embedded sample interval.
On Mon, Oct 26, 2020 at 4:26 PM Luke Cage notifications@github.com wrote:
HI @gcsl https://github.com/gcsl ...
You example has 6 "<" and 7 ">" so I am not sure how they all match as one command.
Your open and closed quotes seem suspect to me also. So, it is hard for me to interpret accurately what you are trying to communicate to me.
Thanks,
Luke
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmi/issues/83#issuecomment-716802631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEL4QL5TMUD2JSZR2C6ZRATSMXLORANCNFSM4S3QAJ7A .
Hi @hellt ... The version of the client you are recommending is 0.4.3. Do you not support a higher version gNMI client?
-bash-4.2$ gnmic version version : 0.4.3 commit : 6d3605c date : 2020-11-10T09:47:23Z gitURL : https://github.com/karimra/gnmic docs : https://gnmic.kmrd.dev -bash-4.2$
@LukeCage
this is the version of the gnmic
client, it has no correlation with gNMI specification version (which is 0.7.0 at this moment, iirc)
In other words, gnmic 0.4.3
can work with gNMI 0.7.0 targets
This is a bit of a relief, @hellt. Thanks.
I am not having any luck running simple commands. I was wondering if you can help me with one ... I have tried your documentation but I still am unable to get a response from my device that works with other gNMI clients.
How would you format a command like this (for example):
gnmi_cli -a 10.111.27.8:6702 -client_crt client_https_rsa40965.cert.pem -client_key client_https_rsa40965.key.pem -with_user_pass -dt s -client_types gnmi -insecure -updates_only -qt s -q /al:alarm-notification
@LukeCage
example for Capabilities RPC
gnmic -a 10.111.27.8:6702 --tls-cert client_https_rsa40965.cert.pem --tls-key client_https_rsa40965.key.pem -u <user_name> -p <password> --skip-verify capabilities
add --log --debug
to see the logging messages with debug level
Thanks, @hellt ...
I'll give that a whirl in the morrow. I appreciate your help!
Luke.
@hellt,
When I get an error message as shown below, how do I figure out the correct structure for the string path (xpath?) to provide to gnmic?
-bash-4.2$ gnmic -a 10.111.27.8:6702 --tls-cert client_https_rsa40965.cert.pem --tls-key client_https_rsa40965.key.pem -u admin -p admin --skip-verify \
get --path /ciena-sys-tmet:system-state/memory --debug 2020/11/12 09:02:01 version=0.4.3, commit=6d3605c, date=2020-11-10T09:47:23Z, gitURL=https://github.com/karimra/gnmic, docs=https://gnmic.kmrd.dev Error: path parse error: invalid string path /ciena-sys-tmet:system-state/memory: invalid node name: "ciena-sys-tmet:system-state" -bash-4.2$
@hellt,
I tried again but modified the xpath I initially used. I replaced the colon with a "/" and it yielded the following result. Still not successful in getting usable results.
-bash-4.2$ gnmic -a 10.111.27.8:6702 --tls-cert client_https_rsa40965.cert.pem --tls-key client_https_rsa40965.key.pem -u admin -p admin --skip-verify get --path /ciena-sys-tmet/logical-core-count --debug
2020/11/12 09:37:16 version=0.4.3, commit=6d3605c, date=2020-11-10T09:47:23Z, gitURL=https://github.com/karimra/gnmic, docs=https://gnmic.kmrd.dev
gnmic 2020/11/12 09:37:16.545572 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: parsed scheme: ""
gnmic 2020/11/12 09:37:16.545609 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: scheme "" not registered, fallback to default scheme
gnmic 2020/11/12 09:37:16.545652 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: ccResolverWrapper: sending update to cc: {[{10.111.27.8:6702
@LukeCage
first, verify that your transport/auth and TLS works by either calling the Capabilities RPC or the get with path /
If either of them works, the transport layer is good.
Now for the actual path that you used, yes, that is a known issue that we for now keep in our backlog...
Essentially, the issue roots in the other package that we use for path parsing - https://github.com/google/gnxi/issues/244
According to that package, the path can't contain a :
char. So far we were waiting on someone from package maintainers to answer our raised issue, but so far no luck.
So before we went ahead and write our own version of path parsing which will support the :
characters in the path I suggest you try the following:
/system-state/memory
Not getting very far with this @hellt
What does the error message "Channel Connectivity change to TRANSIENT_FAILURE" mean? There seems to be a TLS related issue that suspect but I am not sure I am interpreting the message correctly.
gnmic> --address 10.111.22.7:9339 --insecure --username diag --password ciena123 --tls-cert client_https_rsa40965.cert.pem --tls-key client_https_rsa40965.key.pem subscribe --mode stream --stream-mode on-change --path /al/alarm-notification --debug
2020/11/16 14:34:42 version=0.4.3, commit=6d3605c, date=2020-11-10T09:47:23Z, gitURL=https://github.com/karimra/gnmic, docs=https://gnmic.kmrd.dev
gnmic 2020/11/16 14:34:42.837441 /home/runner/work/gnmic/gnmic/cmd/subscribe.go:75: targets: map[10.111.22.7:9339:{"Name":"10.111.22.7:9339","Address":"10.111.22.7:9339","Username":"diag","Password":"ciena123","Timeout":10000000000,"Insecure":true,"TLSCA":null,"TLSCert":null,"TLSKey":null,"SkipVerify":false,"Subscriptions":null,"Outputs":null,"BufferSize":0,"RetryTimer":10000000000}]
gnmic 2020/11/16 14:34:42.837730 /home/runner/work/gnmic/gnmic/cmd/subscribe.go:82: subscriptions: map[default:{"Name":"default","Models":null,"Prefix":"","Target":"","Paths":["/al/alarm-notification"],"Mode":"stream","StreamMode":"on-change","Encoding":"json","Qos":null,"SampleInterval":0,"HeartbeatInterval":0,"SuppressRedundant":false,"UpdatesOnly":false}]
gnmic 2020/11/16 14:34:42.837803 /home/runner/work/gnmic/gnmic/cmd/subscribe.go:89: outputs: map[default-stdout:map[file-type:stdout format: type:file]]
gnmic 2020/11/16 14:34:42.837890 /home/runner/work/gnmic/gnmic/collector/collector.go:108: starting collector with cfg=&{PrometheusAddress: Debug:true Format: TargetReceiveBuffer:1000 RetryTimer:10s}
gnmic 2020/11/16 14:34:42.838090 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: parsed scheme: ""
gnmic 2020/11/16 14:34:42.838114 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: scheme "" not registered, fallback to default scheme
gnmic 2020/11/16 14:34:42.838152 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/grpclog/logger.go:49: ccResolverWrapper: sending update to cc: {[{10.111.22.7:9339
@LukeCage for gnmic related questions I think its better to open an issue in gnmic project.
OK ... Thanks @hellt ... One more question ... does your gNMI client support a certain version of TLS? If so, what version would that be?
I am unable to subscribe to and collect streaming telemetry data from my remote devices. Can someone help me construct the command. An example of a command that works for "ON_CHANGE" (default?) based subscription mode is below:
-bash-4.2$ ./gnmi_cli -a 10.111.27.8:6702 -client_crt client_https_rsa40965.cert.pem -client_key client_https_rsa40965.key.pem -with_user_pass -dt s -client_types gnmi -insecure -updates_only -qt s -q /al:alarm-notification
According to github documentation, on-line, the command takes the following form:
gnmi_cli -address localhost:10161 \ -proto "subscribe:<mode: 0, prefix:<>, subscription:<mode:0, path: <elem: <name: 'openconfig-system:system'> elem: <name: 'clock' > elem: <name: 'config'> elem: <name: 'timezone-name'>>>>" \ -timeout 5s -alsologtostderr \ -polling_interval 5s \ -client_crt certs/client1.crt -client_key certs/client1.key -ca_crt certs/onfca.crt
So, it appears that I have to set the subscription mode (to "SAMPLE") via the -proto option. How would I do this? Every command I issued fails.