diff --git a/snmpsim/grammar/walk.py b/snmpsim/grammar/walk.py index 8510ae6..d44f0e1 100644 --- a/snmpsim/grammar/walk.py +++ b/snmpsim/grammar/walk.py @@ -143,9 +143,13 @@ def _hex_string_filter(value): match = re.match(r'^([0-9a-fA-F]{2}(\s+[0-9a-fA-F]{2})*)\s+\[', value) if match: return [int(y, 16) for y in match.group(1).split(' ')] + elif ' ' in value: + return [int(y, 16) for y in value.split(' ')] + else: + # This could be the format returned by some unknown windows snmpwalk tool: + # .1.3.6.1.2.1.2.2.1.6.1 = HEX-STRING: 00029929AE3C + return [int(value[i:i+2], 16) for i in range(0, len(value), 2)] - return [int(y, 16) for y in value.split(' ')] - @staticmethod def _gauge_filter(value): try: