❦ 17 mai 2017 11:00 +0300, Timo Juhani Lindfors <timo.lindf...@iki.fi> :

> I can't figure out how to get pysnmpwalk to work:
>
> lindi@lindi1:~$ snmpwalk -c public -v 2c  demo.snmplabs.com 
> iso.3.6.1.2.1.1.1.0
> iso.3.6.1.2.1.1.1.0 = STRING: "Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 
> 14:58:11 CDT 2016 i686"
>
> lindi@lindi1:~$ pysnmpwalk -c public -v 2c  demo.snmplabs.com 
> iso.3.6.1.2.1.1.1.0
> Error: No SNMP response received before timeout
>
> Tcpdump shows the following differences:
>
> 10:57:07.453884 IP 10.48.251.223.41220 > 104.236.166.95.161:  
> GetNextRequest(28)  .1.3.6.1.2.1.1.1.0
> 10:57:07.635299 IP 104.236.166.95.161 > 10.48.251.223.41220:  GetResponse(38) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:07.635588 IP 10.48.251.223.41220 > 104.236.166.95.161:  GetRequest(28)  
> .1.3.6.1.2.1.1.1.0
> 10:57:07.816660 IP 104.236.166.95.161 > 10.48.251.223.41220:
> GetResponse(91) .1.3.6.1.2.1.1.1.0="Linux zeus 4.8.6.5-smp #2 SMP Sun
> Nov 13 14:58:11 CDT 2016 i686"
>
>
> 10:57:13.902102 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:14.082021 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:15.086360 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:15.265901 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:16.268647 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:16.450765 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:17.453768 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:17.632806 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:18.635658 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:18.814875 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
> 10:57:19.817602 IP 10.48.251.223.46959 > 104.236.166.95.161:  
> GetNextRequest(27)  .1.3.6.1.2.1.1.1.0
> 10:57:19.999644 IP 104.236.166.95.161 > 10.48.251.223.46959:  GetResponse(37) 
>  .1.3.6.1.2.1.1.2.0=.1.3.6.1.4.1.8072.3.2.10
>
> Am I doing something wrong or is this tool functional at all?

Drop the .0 at the end and it should work. When snmpwalk get an
"out-of-range" response, it retries with a GET request (instead of
GETNEXT) and gets your answer. That's something pysnmpwalk is not
doing. So, you need to ensure that you don't provide an exact OID.
-- 
He hath eaten me out of house and home.
                -- William Shakespeare, "Henry IV"

Attachment: signature.asc
Description: PGP signature

Reply via email to