03-04-2024 12:49 AM
I have been trying to collect telemetry data and I am getting a hard time obtaining power data.
Here's a sample telemetry collector config (telegraf):
```
```
According to YANGSUITE, I should get Datatype:`ieeefloat32` in Basetype:`binary`, but for some reason I get unreadable values like this:
```
```
Can anyone tell my what kind of encoding is this?
Other yang models sends the data correctly, but for `openconfig-platform-psu` the data is somehow encoded?
It's not base64, I already tried to decode it.
Can anyone shed some light please?
For Additional Info:
SW: `C9300-48UXM`
IOS-XE ver: `17.09.04a`
Solved! Go to Solution.
03-04-2024 01:39 AM - edited 03-04-2024 01:43 AM
These values are base64 encoded ieeefloat32 as described. If you decode from base64 to binary, you can quite easily convert it to ieeefloat32. For example:
Base64: QmF3zw== (output voltage)
Binary: 01000010 01100001 01110111 11001111
Float32: 56.367
03-04-2024 02:19 AM
Base64 encoding is sometimes used for binary data transmission, it's not the default for GNMI with protobuf encoding as far as i recall. Try your telegraf configuration using the encoding parameter with a value "binary" in the [[inputs.gnmi]] section, this will tell GNMI to retrieve the data in raw binary format here.
Hope this helps.
03-04-2024 01:39 AM - edited 03-04-2024 01:43 AM
These values are base64 encoded ieeefloat32 as described. If you decode from base64 to binary, you can quite easily convert it to ieeefloat32. For example:
Base64: QmF3zw== (output voltage)
Binary: 01000010 01100001 01110111 11001111
Float32: 56.367
03-04-2024 02:19 AM
Base64 encoding is sometimes used for binary data transmission, it's not the default for GNMI with protobuf encoding as far as i recall. Try your telegraf configuration using the encoding parameter with a value "binary" in the [[inputs.gnmi]] section, this will tell GNMI to retrieve the data in raw binary format here.
Hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide