etingof / snmpsim

SNMP Simulator

Home Page:http://snmplabs.com/snmpsim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SNMP communication

jaimesaez97 opened this issue · comments

Hello there.

I am trying to debug a simple SNMP agent and querying it.

I am raising the SNMP agent through this command:
$ python snmpsim.commands.responder.py --data-dir=./data --agent-udpv4-endpoint=127.0.0.1:1024

And I receive the following info:
Screenshot from 2020-09-28 12-02-58
Screenshot from 2020-09-28 12-03-10
be
I am querying existing SNMP agent by the following command:
$ pyton snmpsim.commands.cm2rec.py --agent-udpv4-endpoint=127.0.0.1:1024 --output-file=/home/jaime/Documents/snmpsim/data/public.snmprec

And I receive the following info:
Screenshot from 2020-09-28 12-04-45

I am triying to debug the communication between two process but I am not able to discover where is the SNMP-agent communication function.

Where is the code point where MIBs are sent from SNMP agent side?

Thank you,
Jaime.

commented

you are using --data-dir=./data as data source of SNMP agent, is there any data there in the folder?

you are using --data-dir=./data as data source of SNMP agent, is there any data there in the folder?

This folder is the data folder inside SNMPSIM project (snmpsim/data).

commented

you are using --data-dir=./data as data source of SNMP agent, is there any data there in the folder?

This folder is the data folder inside SNMPSIM project (snmpsim/data).

Can you try without the parameter? from your screenshot, seemed it load nothing.

image

Without this parameter I get back the same error. I think the problem is the SNMP agent can not fin any MIB to reply the query.

Screenshot from 2020-10-07 10-14-46
Screenshot from 2020-10-07 10-14-54

commented

Without this parameter I get back the same error. I think the problem is the SNMP agent can not fin any MIB to reply the query.

Screenshot from 2020-10-07 10-14-46
Screenshot from 2020-10-07 10-14-54

I would suggest you check the environment you are using and the step snmpsim you ran snmpsim.
Log will be printed when the data is loaded:
image

Without this parameter I get back the same error. I think the problem is the SNMP agent can not fin any MIB to reply the query.
Screenshot from 2020-10-07 10-14-46
Screenshot from 2020-10-07 10-14-54

I would suggest you check the environment you are using and the step snmpsim you ran snmpsim.
Log will be printed when the data is loaded:
image

Are you running server and client like this?

python snmpsim/snmpsim/commands/responder.py --agent-udpv4-endpoint=127.0.0.1:1024
python snmpsim/snmpsim/commands/cmd2rec.py --agent-udpv4-endpoint=127.0.0.1:1024 --output-file=/home/jaime/Documents/Projects/snmpsim/data/public.snmprec
commented

Without this parameter I get back the same error. I think the problem is the SNMP agent can not fin any MIB to reply the query.
Screenshot from 2020-10-07 10-14-46
Screenshot from 2020-10-07 10-14-54

I would suggest you check the environment you are using and the step snmpsim you ran snmpsim.
Log will be printed when the data is loaded:
image

  1. cmd2rec unable to got data because responder failed to load data
  2. I'm not in your way to load the SNMP agent, I ran it as the document described: snmpsim-command-responder --agent-udpv4-endpoint=127.0.0.1:1024
  3. Please make sure #2 works 1st, then you can dig into the SNMPsim code to see how it load the data.

I am trying to introduce some security into the project through ciphering and I need to launch it through python snmpsim/commands/responder.py.
When I try to launch it from terminal, I get another output:

python snmpsim/commands/responder.py --agent-udpv4-endpoint=127.0.0.1:1024

The correct data_dir is /usr/local/lib/python2.7/dist-packages/snmpsim-1.0.0-py2.7.egg/snmpsim/data.
Output:
Screenshot from 2020-10-07 10-44-31

But the client does not return any OID:

python snmpsim/commands/cmd2rec.py --agent-udpv4-endpoint=127.0.0.1:1024 --output-file=/home/jaime/Documents/Projects/snmpsim/data/public.snmprec

Output:
Screenshot from 2020-10-07 10-45-31

"OIDs dumped: 0"