gnmi icon indicating copy to clipboard operation
gnmi copied to clipboard

How to properly setup the config file for fake_server

Open delmotteo opened this issue 4 years ago • 1 comments

Hi,

I would like to use gnmi_cli to connect to the fake_server simulator (https://github.com/openconfig/gnmi/tree/master/testing/fake/gnmi/cmd/fake_server). I started the (fake) server and it seems ok: I0921 14:37:47.773644 9483 server.go:115] Starting RPC server on address: localhost:8080

Unfortunetly, when I send a request from gnmi_cli, I get an empty response:

mzadmin@mzadmin-VirtualBox:~$ gnmi_cli -a localhost:8080 -q '*' -logtostderr -insecure -qt s {} mzadmin@mzadmin-VirtualBox:~$

And an error message appears on the server side:

E0921 14:38:48.043118 9483 client.go:226] Client gnmi_sim error: end of updates

The thing is, I don't know how to set up properly the server, using the config file. In particular, I don't know how I specify which sensor paths are to be made available. And how I can assign values to the sensors? Is it possible to have the values being generated randomly and dynamically so that two consecutive messages have different values?

I have seen the gen_config tool that may help in some way. But I don't know how to use that either.

Any help is appreciated.

Thank you

delmotteo avatar Sep 21 '20 16:09 delmotteo

I'm not even getting this far. This is what I get

sendQueryAndDisplay(ctx, {Addrs:[localhost:8180] AddressChains:[] Target: Replica:0 UpdatesOnly:false Queries:[[*]] Type:stream Timeout:30s NotificationHandler:<nil> ProtoHandler:<nil> Credentials:<nil> TLS:<nil> Extra:map[] SubReq:<nil> TunnelConn:<nil>}, &{PollingInterval:30s StreamingDuration:0s Count:0 countExhausted:false Delimiter:/ Display:0x875ae0 DisplayPrefix: DisplayIndent:   DisplayType:group DisplayPeer:false Timestamp: DisplaySize:false Latency:false ClientTypes:[gnmi] Location:UTC}):
        client "gnmi" : client "gnmi" : Dialer(localhost:8180, 30s): context deadline exceeded

This really should not be happening. I followed all the instructions on that page. Of which there weren't too many. Please help!

mahnoorfirdous avatar Jun 01 '23 16:06 mahnoorfirdous