You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encounter a value evaluation error when using the subprocess variation module to update hexlified values in .snmprec files.
I'm using HOST-RESOURCES-MIB::hrSystemDate for illustration with the use case to return the current timestamp whenever polled. The value is a RFC2579 DateAndTime octet string.
I now update the snmprec to use subprocess to provide the octetstring. snmpsimd logs the following error:
ERROR data error at /home/someuser/pydev/snmpsim/data/snmpwalk/host.snmprec controller for 1.3.6.1.2.1.25.1.2: value evaluation error for tag '4', value b'07e30307001b01152b0000\n'
The issue remains no matter which approach I use e.g.
1.3.6.1.2.1.25.1.2.1|4x:subprocess|get_date.py <=== this is the desired approach
1.3.6.1.2.1.25.1.2.1|4x:subprocess|echo 07e30307001b01152b0000
1.3.6.1.2.1.25.1.2.1|4:subprocess|echo hexvalue=07e30307001b01152b0000
The last example doesn't result in an error, but it ends up passing a hexflified value for the whole 'hexvalue=07e30307001b01152b0000' string which doesn't produce the desired outcome. I don't believe hexvalue is supported for subprocess as it's not mentioned in the docs.
I can reproduce the issue on versions 0.4.6 and 0.4.7 on RHEL Python 3.6/3.7.
UPDATED: It works when running snmpsim on Python 2.7.
Is there anything to be done to help it along in Python 3?
Thanks!
Pieter
The text was updated successfully, but these errors were encountered:
pieterheydenrych
changed the title
Value evaluation error for subprocess and hexlified values
snmpsimd.py: Value evaluation error for subprocess and hexlified values
Mar 7, 2019
I encounter a value evaluation error when using the subprocess variation module to update hexlified values in .snmprec files.
I'm using HOST-RESOURCES-MIB::hrSystemDate for illustration with the use case to return the current timestamp whenever polled. The value is a RFC2579 DateAndTime octet string.
Raw capture:
snmpwalk result using the default raw capture:
I now update the snmprec to use subprocess to provide the octetstring. snmpsimd logs the following error:
The issue remains no matter which approach I use e.g.
The last example doesn't result in an error, but it ends up passing a hexflified value for the whole 'hexvalue=07e30307001b01152b0000' string which doesn't produce the desired outcome. I don't believe hexvalue is supported for subprocess as it's not mentioned in the docs.
I can reproduce the issue on versions 0.4.6 and 0.4.7 on RHEL Python 3.6/3.7.
UPDATED: It works when running snmpsim on Python 2.7.
Is there anything to be done to help it along in Python 3?
Thanks!
Pieter
The text was updated successfully, but these errors were encountered: