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

SNMP communication #152

Open
jaimesaez97 opened this issue Sep 28, 2020 · 8 comments
Open

SNMP communication #152

jaimesaez97 opened this issue Sep 28, 2020 · 8 comments

Comments

@jaimesaez97
Copy link

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.

@gainskills
Copy link

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

@jaimesaez97
Copy link
Author

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).

@gainskills
Copy link

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

@jaimesaez97
Copy link
Author

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

@gainskills
Copy link

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

@jaimesaez97
Copy link
Author

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

@gainskills
Copy link

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 couldn't create a lot for simulator. #2 works 1st, then you can dig into the SNMPsim code to see how it load the data.

@jaimesaez97
Copy link
Author

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"

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

2 participants