-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
snmpsimd: For SNMPv3 context name has to be specified. #88
Comments
Looks totally reasonable to me! Trouble is that default SNMPv3 context is an empty string. Given snmpsim's model of file-based agent addressing and unavailability of empty file name on most (?) file systems, may be we should iterate over all combinations of
That can cause conflicts, however perhaps resolvable in every particular situation... Alternatively, may be we could solve this by adding
Then WDYT? |
It just occurred to be, that you can simulate empty SNMP context name by having your .snmprec files in form of transport-id.snmprec. Anyway, I've added a hopefully clearer solution (#89) by introducing context-engine-id component into the search path (option two from the above comment). For better usability actual SNMP context engine ID from request is automatically replaced with self if it equals to local SNMP engine ID. With #89, this path should map to empty SNMP community/context name:
Let me know if that works for you. |
yes,it works. Thank you very much. |
Hi,
I am using saved cache files, but I am not sure if that matters. My startup is: start snmpsimd.py --cache-dir=./cache --data-dir=./data --variation-modules-dir=./variation --v3-only ^ When I set the snmrec file to self.snmprec, and have my cache files named as data_self.dbm.XXX, I get he following output:
If I use "590f53e8699817c6fa498cc11a4cbe63" or "self" for the context name I connect and get output like:
but with "" as the Context ID I get:
Any help on how to get this working correctly? |
@kuhnto I'm trying to use the snmpsim as v3 agent. Since the snmp labs is down, I don't have access to their documentation. Can you please help here on how to start the snmpsim as v3 . Also is there a way to start the agent as both v2 and v3 ? Currently I'm starting the agent as v2 and that works fine as follows. ( I do get responses on writing snmp client / using snmpget as "snmpget -v 2c -c public 127.0.0.1:1024 sysUpTime.0") |
This is what I am starting my emulator with: snmpsimd.py --cache-dir=c:\snmpsim\cache --data-dir=c:\snmpsim\data --variation-modules-dir=c:\snmpsim\variation --v3-only ^ |
try with the latest version. |
Thanks @kuhnto and @gainskills . I was able to launch the simulator in v3 mode. But when launching in v3 mode with CMD line similar to what you posted, I have seen it generates some transport-ID, eg as below CMD: snmpsimd.py --v3-user=v3 --v3-auth-proto SHA --v3-priv-proto AES128 --v3-auth-key=test1234 --v3-priv-key=test1234 --data-dir=/usr/snmpsim/data --log-level=debug --logging-method=file:/logs/simulator.log --variation-modules-dir=/usr/snmpsim/variation --agent-udpv4-endpoint=127.0.0.1:1024 snmpsimd: Listening at UDP/IPv4 endpoint 127.0.0.1:1024, transport ID 1.3.6.1.6.1.1.0 Now for any snmget, it always fetches the file named 1.3.6.1.6.1.1.0/127.0.0.1.snmprec. |
When using snmpwalk to get information from real device, context name is unnecessary. But when get information from snmpsimd context name must be specified, otherwise nothing can be retrieved. It's better for snmpsimd to have the same behavior with real device?
The text was updated successfully, but these errors were encountered: