etingof / snmpsim

SNMP Simulator
http://snmplabs.com/snmpsim/
BSD 2-Clause "Simplified" License
383 stars 121 forks source link

GetRequest #21

Closed varelochka closed 6 years ago

varelochka commented 6 years ago

GetRequest command to non existing OID in capture return next data instead of noSuchIstance. GetRequest works like GetNextRequest.

etingof commented 6 years ago

Could you please cut&paste your command-line or log or whatever would help me debug that? For example this works as expected, no?

$ snmpget -v2c -c public demo.snmplabs.com 1.3.6
SNMPv2-SMI::dod = No Such Instance currently exists at this OID
varelochka commented 6 years ago

Two captures attached. good.cap (simulator Written by Ilya Etingof ilya@glas.net, 05/2010, I don't know exact version) not_good.cap - simulator version 0.3.1

Log from simulator version 0.3.1: Request var-binds: 1.3.6.1.2.1.17.1.1.0=<>, flags: EXACT, GET Response var-binds: 1.3.6.1.2.1.23.1.1.0=<0>

For me this works as not expected in version 0.3.1

capture.zip

varelochka commented 6 years ago

test.zip For the test MVC file I trying to get OID 1.3.6.1.2.1.17.1.1.0 (Ubuntu 16.04.2 LTS, snmpsimd version 0.3.1): snmpget -v2c -ctest 192.168.7.133 1.3.6.1.2.1.17.1.1.0 iso.3.6.1.2.1.23.1.1.0 = Counter32: 0

Log from snmpsimd: Using ../snmpsim/data/test.MVC controller selected by candidate 098f6bcd4621d373cade4e832627b4f6; transport ID 1.3.6.1.6.1.1.0, source address 192.168.7.133, context name "098f6bcd4621d373cade4e832627b4f6" SNMP EngineID 0x80004fb8057562756e747504533a2c, transportDomain (1, 3, 6, 1, 6, 1, 1, 0), transportAddress ('192.168.7.133', 35024), securityModel 2, securityName 098f6bcd4621d373cade4e832627b4f6, securityLevel 1 Request var-binds: 1.3.6.1.2.1.17.1.1.0=<>, flags: EXACT, GET Response var-binds: 1.3.6.1.2.1.23.1.1.0=<0>

I always got OID 1.3.6.1.2.1.23.1.1.0 in answer but must got error No Such Instance.

mofikus commented 6 years ago

Hi

I also have this issue, attached a walk file. If I poll 1.3.6.1.2.1.15.4.1 the response is:

.1.3.6.1.2.1.31.1.1.1.1.1 = STRING: "GE0/0/0"

When it should be no such instance. This is using a snmpwalk file, not a snmprec file.

Log from snmpsimd:

Listening at UDP/IPv4 endpoint 192.168.100.2:1161, transport ID 1.3.6.1.6.1.1.0 Using /home/mofikus/edited-device93.snmpwalk controller selected by candidate b'f0fedc721631f3f929c81eab7bc700f8'; transport ID 1.3.6.1.6.1.1.0, source address 10.44.3.33, context name "b'f0fedc721631f3f929c81eab7bc700f8'" SNMP EngineID 0x80004fb805676e7333766d2e87fcc8, transportDomain (1, 3, 6, 1, 6, 1, 1, 0), transportAddress ('10.44.3.33', 61666), securityModel 1, securityName f0fedc721631f3f929c81eab7bc700f8, securityLevel 1 Opening /home/mofikus/edited-device93.snmpwalk controller Request var-binds: 1.3.6.1.2.1.15.4.1=<>, flags: EXACT, GET Response var-binds: 1.3.6.1.2.1.31.1.1.1.1.1=<GE0/0/0>

snmpsimd was run with the following:

snmpsimd.py --data-dir=/home/mofikus --agent-udpv4-endpoint=192.168.100.2:1161

etingof commented 6 years ago

@mofikus Could you please attach your .snmpwalk file and also make sure you are using the latest snmpsim version released?

etingof commented 6 years ago

Alright, that was a bug which is hopefully fixed by d174a7454f24e539671079af84167b028777ba61 (actually, master HEAD).

I'd appreciate your testing before I make a release.

Thanks! ;-)

etingof commented 6 years ago

@varelochka I beg your pardon for overlooking your issue... It is hopefully fixed by now in master.

mofikus commented 6 years ago

Sorry I forgot to attach the walk, but I've just tested your changes and it appears to have fixed the issue. Thank you!

etingof commented 6 years ago

snmpsim 0.4.3 has been released on PyPI.

varelochka commented 6 years ago

Thanks a lot! Issue fixed.

On 10 February 2018 at 11:38, Ilya Etingof notifications@github.com wrote:

@varelochka https://github.com/varelochka I beg your pardon for overlooking your issue... It is hopefully fixed by now in master.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/etingof/snmpsim/issues/21#issuecomment-364639219, or mute the thread https://github.com/notifications/unsubscribe-auth/AEejZQRjuW9JLGswSS5ZQ_i8Uoa6cVoWks5tTWOygaJpZM4PXLkT .