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

writecache and hex values #135

Open
mmodenesi opened this issue Mar 23, 2020 · 0 comments
Open

writecache and hex values #135

mmodenesi opened this issue Mar 23, 2020 · 0 comments

Comments

@mmodenesi
Copy link

Good behavior

Given this mib file

root@a0b8702ee6f6:/# cat /tmp/snmprec/write.snmprec 
1.3.6.1.2.1.27070.3.1.2.2.2.1.5.1|64x|0a110019

When served with this command line:

snmpsim-command-responder --data-dir=/tmp/snmprec --agent-udpv4-endpoint=0.0.0.0:161 --process-user root --process-group root --debug all

Is avaliable to be queried:

root@d4abfe8a1569:/# snmpwalk -v 2c -c write snmphost:161
iso.3.6.1.2.1.27070.3.1.2.2.2.1.5.1 = IpAddress: 10.17.0.25
iso.3.6.1.2.1.27070.3.1.2.2.2.1.5.1 = No more variables left in this MIB View (It is past the end of the MIB tree)

Bad behavior

If I want to use writecache to allow write operations to be simulated, then

root@a0b8702ee6f6:/# cat /tmp/snmprec/write.snmprec 
1.3.6.1.2.1.27070.3.1.2.2.2.1.5.1|64x:writecache|value=0a110019

Is not available to be queried:

root@d4abfe8a1569:/# snmpwalk -v 2c -c write dektec:161
iso.3.6.1.2.1 = No more variables left in this MIB View (It is past the end of the MIB tree)

And I see this error log:

ERROR data error at /tmp/snmprec/write.snmprec controller for 1.3.6.1.2.1: value evaluation for 1.3.6.1.2.1.27070.3.1.2.2.2.1.5.1 = 'value=0a110019' failed: Bad IP address syntax 0a110019caused by <class 'ValueError'>: invalid literal for int() with base 10: '0a110019

As a workaround, I can serve the "writable" version with

1.3.6.1.2.1.27070.3.1.2.2.2.1.5.1|64:writecache|value=10.17.0.25

Is it ok that writecache is not properly handling the x in 64x?

Thank you!

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

1 participant