pysnmp icon indicating copy to clipboard operation
pysnmp copied to clipboard

Noob question

Open Cristianistrate opened this issue 4 years ago • 9 comments

I intalled pysnmp and if I open an example ai get some errors when running: AttributeError: module 'pysnmp.carrier.asyncore.dgram.udp' has no attribute 'DOMAIN_NAME' or NameError: name 'USM_AUTH_HMAC96_SHA' is not defined

Please, tell me what I do wrong.

Cristianistrate avatar Aug 01 '19 13:08 Cristianistrate

Could you share which pysnmp version you have installed and what example you trying to run?

etingof avatar Aug 01 '19 13:08 etingof

listen-on-ipv4-and-ipv6-interfaces.py python 3.7.3. as for pysnmp i just pip installed a few minutes ago

Cristianistrate avatar Aug 01 '19 13:08 Cristianistrate

I suspect you have taken the example from GitHub master (pysnmp 5.x.x), but installed pysnmp (4.4.10) from PyPI. Then you should take examples from release-4.4.10 branch.

etingof avatar Aug 01 '19 14:08 etingof

Thanks, i will try to install 5

Cristianistrate avatar Aug 01 '19 14:08 Cristianistrate

Just keep in mind that pysnmp 4 is stable, pysnmp 5 is still in development (though it should work).

etingof avatar Aug 01 '19 14:08 etingof

Ok. Thanks.

Cristianistrate avatar Aug 01 '19 14:08 Cristianistrate

One more think, when i run the example provided by you above a got this error (127.0.0.1): WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

when I put a printer IP isnotead of 127....: [WinError 10049] The requested address is not valid in its context

Cristianistrate avatar Aug 01 '19 14:08 Cristianistrate

I think the system prevents you from binding port 161 unless you are a superuser.

Printer IP perhaps is a remote IP, you can only listen on local IP interfaces.

You may try ('0.0.0.0', 1024), that should avoid both of the above mentioned problems.

etingof avatar Aug 01 '19 14:08 etingof

You can also change DOMAIN_NAME to domainName in the code.

safadig avatar Jan 20 '22 22:01 safadig