charlestolley / python-snmp

A user-friendly SNMP library
MIT License
15 stars 3 forks source link

Example throws exception #1

Closed hpavon closed 3 years ago

hpavon commented 5 years ago

Hi mate,

I just copied your example code, substituted hosts with my remote NTCIP machine IP (checkd that it was online first) and ran it. Here's the result:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\hpavon-e\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\hpavon-e\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\hpavon-e\AppData\Local\Programs\Python\Python37-32\lib\site-packages\snmp\v1\__init__.py", line 58, in _listen_thread
    r, _, _ = select.select([sock, pipe], [], [])
OSError: [WinError 10038] an operation was attempted on something that is not a socket

I guess it's just that being a noob I have missed something. Any help will be much appreciated.

PS: I can get proper response from remote machine executing in command line: snmpget -v1 -c administrator <my host's IP here> .1.3.6.1.2.1.1.2.0

charlestolley commented 5 years ago

Hi, sorry I didn't see this earlier, I may have forgotten to include this in the README, but I wrote this on a Linux machine, and am not currently supporting Windows. It's not your fault, maybe I'll have to look into that

charlestolley commented 3 years ago

UPDATE: I just released a new version that supports Windows. I've always been a Linux guy, but I decided to take a swing at it, and it turned out it didn't take all that much to make it work. I'm working on some major improvements, and I hope to have support for SNMPv2c and SNMPv3 soon as well. I was planning to wait to release the Windows change with that new version, but I decided it was worth getting it in sooner rather than later. I'm happy to field any feedback on how it works from others who use Windows regularly.