-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[inputs.snmp] bits conversion fails #15963
Comments
This is similar to #14694 If I try converting to enum instead, then there is no output at all. |
Again this strange OID 😛 So you are saying with the exact same config file works fine on Ubuntu, but gives this error when running on MacOS? Are the telegraf versions also exact the same? PS; I created a new conversion named displayhint in #15935 which can convert the returned value exactly like how the net-snmp tools are doing it. You can try it out with the current nightly builds.. |
Yes exactly |
My mistake — this is actually a regression in Telegraf version 1.32. Not related to the OS. It works in 1.30.3. |
@Hipska thanks for the tip. Unfortunately displayhint doesn't work either; it ends up like this: If I convert to hex, then I get a string |
Actually, you would just need the Could you confirm? |
That doesn't work either. With
I also tried
|
Could you have a try with the build artifacts from #16027? |
Thank you! With that build |
Did you also test with a device responding something else than |
Ah! Thanks, you're right. |
Sorry, I spoke too soon. These results still don't make much sense to me. With the lamp turned on I get this. The string is "on" and the number is 7.
With no conversion Telegraf returns Now with the lamp turned off:
With no conversion Telegraf returns |
Yeah, your device is sending |
I'm not sure where you got the 2 extra zeroes; it looks to me like the device is sending
|
Oh, now I'm getting what this OID is returning. It is counting the bits backwards;
Could you try again with If that result is still not helpful, best option is to use |
Wow, what a weird system! Now it makes sense, thank you. With lamp on, displayhint returns Using
In the same vein as my other FR for TruthValue... I was thinking it would be nice for Telegraf to have a conversion matching all possible SNMP data types. Not necessary though. Edit: Thinking about this more, I think it's actually a vendor bug for this device to be sending a value of |
I have another example, that hurt my brain for 10 minutes figuring this out. From the MIB:
So I set conversion to
If I were writing to influx, I could just use conversion |
I have the same problem using Graphite. I think you need to quote your hex values for it to work? And need to add this to be complete: |
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.32, MacOS 13.6.9
Steps to reproduce
Run this telegraf config
Expected behavior
The device returns a bits type value of 00. Telegraf should convert this to an integer 0.
Actual behavior
The conversion fails.
Additional info
This is a problem in 1.31 and 1.32 but it works fine in 1.30.3.
Below is the snmpget output from this same MacOS machine.
Here's the relevant section from the MIB:
The text was updated successfully, but these errors were encountered: