Telemetry Receiver by UDP+KV-GPB
In the article, only show as follow (because easy to show how to work):
Protocol: UDP; Port: 5234
Encoding: KV-GPB
For more detailed information, you can reference my colleague’s GitHub, which includes more examples, e.g GRPC.
AlexFengCisco / Telemetry_Receiver
GRPC Update Info:
If use GRPC not TCP/UDP, that will have standard function, you will not need to write “DECODE_FN_MAP…”, function will auto generate, direct to use. Simple list steps:
- Get GRPC protobuf (e.g “mdt_grpc_dialout”) from cisco / bigmuddy-network-telemetry-proto
- Install/use compile tools, suggest install python virtual env, you can reference 在MacOS中部署Python虚拟开发环境
(telemetry-protocol) [[email protected] telemetry-protocol]# python -V Python 3.6.8 (telemetry-protocol) [[email protected] telemetry-protocol]# easy_install pip (telemetry-protocol) [[email protected] telemetry-protocol]# pip install grpcio (telemetry-protocol) [[email protected] telemetry-protocol]# pip install protobuf (telemetry-protocol) [[email protected] telemetry-protocol]# pip install grpcio_tools (telemetry-protocol) [[email protected] telemetry-protocol]# python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. cisco_grpc_dialout.proto (telemetry-protocol) [[email protected] telemetry-protocol]# ls -l|grep cisco -rw-r--r--. 1 root root 2695 Aug 10 16:16 cisco_grpc_dialout_pb2_grpc.py #generated -rw-r--r--. 1 root root 3805 Aug 10 16:16 cisco_grpc_dialout_pb2.py #generated -rw-r--r--. 1 root root 485 Aug 10 16:15 cisco_grpc_dialout.proto #proto fileFollow all file if you need grpc protocol:[[email protected] grpc-dailout]# ls -l total 36 -rw-r--r--. 1 root root 2695 Aug 10 16:16 cisco_grpc_dialout_pb2_grpc.py #Contains the server Stub class and the client Stub class, as well as the service RPC interface to be implemented. -rw-r--r--. 1 root root 3805 Aug 10 16:16 cisco_grpc_dialout_pb2.py #message serialization classes -rw-r--r--. 1 root root 484 Aug 10 15:36 mdt_grpc_dialout.proto -rw-r--r--. 1 root root 3722 Aug 10 16:11 service_grpc_dialout_no_tls.py #service python -rw-r--r--. 1 root root 19220 Aug 10 15:58 telemetry_pb2.py #decode gpb-kv messages, generate as belowgrpc-dailout.zip