Skip to content
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

Issue with MAC address return #17

Open
deveshmanish opened this issue Aug 29, 2020 · 1 comment
Open

Issue with MAC address return #17

deveshmanish opened this issue Aug 29, 2020 · 1 comment

Comments

@deveshmanish
Copy link

The current implementation does not return the correct mac address. In my scenario the MAC address returned is in Hex-String format. It throws a

TypeError: 'str' object cannot be interpreted as an integer

Which is correct since the mac_address function uses
":".join([hex(c).lstrip("0x").zfill(2) for c in string])
which is correct since hex(c) expects an integer not a string.
I tried bypassing the function all together but that too doesn't return the expected output. The mac address seems to be encoded.

Is there a way to get the actual value returned by the SNMP get/walk?
In my own implementation of mac_address the correct address is returned by the following code:
':'.join(mac[i:i + 2] for i in range(2, 12, 2))
But this too won't work unless the actual raw value or value.prettyPrint() is passed to it.

@trehn
Copy link
Owner

trehn commented Nov 28, 2021

Can you provide an example repr() or the returned value? Ideally from PySNMP as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants