etingof / snmpclitools

Pure-Python SNMP management tools
http://snmplabs.com/snmpclitools/
BSD 2-Clause "Simplified" License
53 stars 16 forks source link

No SNMP response received before timeout #7

Closed AllenX01 closed 5 years ago

AllenX01 commented 5 years ago

Hi, From a beginner: A failure like this "No SNMP response received before timeout" in case of the below command input: 1)snmpget.py -v3 -u usr-sha-aes -l authPriv -A authkey1 -X privkey1 demo.snmplabs.com IP-MIB::ipAdEntBcastAddr.\"127.0.0.1\" 2)snmpget.py -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com sysDescr.0

Do I need to do some network configuration? My OS: VMware +Ubuntu16.04

Hope you help me out.

etingof commented 5 years ago

I suspect a firewall problem. Exactly the same command works for me:

$ snmpget.py -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com sysDescr.0
SNMPv2-MIB::sysDescr.0 = DisplayString: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686 
$

You may want to enable some debugging to see if anything comes back to you:

$ snmpget.py --debug io  -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com sysDescr.0
2019-01-11 07:41:57,817 pysnmp: running pysnmp version 4.4.4
2019-01-11 07:41:57,817 pysnmp: debug category 'io' enabled
2019-01-11 07:41:58,019 pysnmp: UdpSocketTransport: socket 8 buffer size increased from 9216 to 131070 for buffer 4097
2019-01-11 07:41:58,024 pysnmp: sendMessage: outgoingMessage queued (64 octets) 
00000: 30 3E 02 01 03 30 11 02 04 00 FD FD CC 02 03 00 
00016: FF E3 04 01 04 02 01 03 04 10 30 0E 04 00 02 01 
00032: 00 02 01 00 04 00 04 00 04 00 30 14 04 00 04 00 
00048: A0 0E 02 04 00 87 B6 A2 02 01 00 02 01 00 30 00
2019-01-11 07:41:58,024 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x105d5a550 tagSet <TagSet object at 0x10512a550 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x105c61ba8 consts <ValueSizeConstraint object at 0x1052c3898 consts 0, 65535>, <ValueSizeConstraint object at 0x105c61b70 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (64 octets) 
00000: 30 3E 02 01 03 30 11 02 04 00 FD FD CC 02 03 00 
00016: FF E3 04 01 04 02 01 03 04 10 30 0E 04 00 02 01 
00032: 00 02 01 00 04 00 04 00 04 00 30 14 04 00 04 00 
00048: A0 0E 02 04 00 87 B6 A2 02 01 00 02 01 00 30 00
2019-01-11 07:41:59,029 pysnmp: sendMessage: outgoingMessage queued (64 octets) 
00000: 30 3E 02 01 03 30 11 02 04 00 FD FD CD 02 03 00 
00016: FF E3 04 01 04 02 01 03 04 10 30 0E 04 00 02 01 
00032: 00 02 01 00 04 00 04 00 04 00 30 14 04 00 04 00 
00048: A0 0E 02 04 00 87 B6 A3 02 01 00 02 01 00 30 00
2019-01-11 07:41:59,029 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x105d5a550 tagSet <TagSet object at 0x10512a550 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x105c61ba8 consts <ValueSizeConstraint object at 0x1052c3898 consts 0, 65535>, <ValueSizeConstraint object at 0x105c61b70 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (64 octets) 
00000: 30 3E 02 01 03 30 11 02 04 00 FD FD CD 02 03 00 
00016: FF E3 04 01 04 02 01 03 04 10 30 0E 04 00 02 01 
00032: 00 02 01 00 04 00 04 00 04 00 30 14 04 00 04 00 
00048: A0 0E 02 04 00 87 B6 A3 02 01 00 02 01 00 30 00
2019-01-11 07:41:59,033 pysnmp: handle_read: transportAddress ('104.236.166.95', 161) -> ('0.0.0.0', 53950) incomingMessage (113 octets) 
00000: 30 6F 02 01 03 30 11 02 04 00 FD FD CC 02 03 00 
00016: FF E3 04 01 00 02 01 03 04 20 30 1E 04 0E 80 00 
00032: 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 02 
00048: 03 0B 4A 52 04 00 04 00 04 00 30 35 04 0E 80 00 
00064: 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 04 00 A8 21 
00080: 02 04 00 87 B6 A2 02 01 00 02 01 00 30 13 30 11 
00096: 06 0A 2B 06 01 06 03 0F 01 01 04 00 41 03 02 34 
00112: 0F
2019-01-11 07:41:59,397 pysnmp: handle_read: transportAddress ('104.236.166.95', 161) -> ('0.0.0.0', 53950) incomingMessage (113 octets) 
00000: 30 6F 02 01 03 30 11 02 04 00 FD FD CD 02 03 00 
00016: FF E3 04 01 00 02 01 03 04 20 30 1E 04 0E 80 00 
00032: 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 02 
00048: 03 0B 4A 53 04 00 04 00 04 00 30 35 04 0E 80 00 
00064: 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 04 00 A8 21 
00080: 02 04 00 87 B6 A3 02 01 00 02 01 00 30 13 30 11 
00096: 06 0A 2B 06 01 06 03 0F 01 01 04 00 41 03 02 34 
00112: 10
2019-01-11 07:41:59,406 pysnmp: sendMessage: outgoingMessage queued (146 octets) 
00000: 30 81 8F 02 01 03 30 11 02 04 00 FD FD CE 02 03 
00016: 00 FF E3 04 01 07 02 01 03 04 3D 30 3B 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 00 
00048: 02 01 00 04 0B 75 73 72 2D 6D 64 35 2D 64 65 73 
00064: 04 0C 37 DD 4A F8 3E FA E0 C5 79 A3 27 90 04 08 
00080: 00 00 00 00 2B D1 82 F5 04 38 DB 10 FF 96 52 B0 
00096: 9A 81 B7 B8 84 3A 02 A5 6C DF 5B 91 06 E2 D0 8D 
00112: 3E 19 D2 EF 3A A6 6F 87 46 0D 6D 82 B9 72 AF 68 
00128: C7 49 E2 43 33 BA 9A 15 32 40 6E B8 D1 07 A9 A6 
00144: 79 1E
2019-01-11 07:41:59,406 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x105d5a550 tagSet <TagSet object at 0x10512a550 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x105c61ba8 consts <ValueSizeConstraint object at 0x1052c3898 consts 0, 65535>, <ValueSizeConstraint object at 0x105c61b70 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (146 octets) 
00000: 30 81 8F 02 01 03 30 11 02 04 00 FD FD CE 02 03 
00016: 00 FF E3 04 01 07 02 01 03 04 3D 30 3B 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 00 
00048: 02 01 00 04 0B 75 73 72 2D 6D 64 35 2D 64 65 73 
00064: 04 0C 37 DD 4A F8 3E FA E0 C5 79 A3 27 90 04 08 
00080: 00 00 00 00 2B D1 82 F5 04 38 DB 10 FF 96 52 B0 
00096: 9A 81 B7 B8 84 3A 02 A5 6C DF 5B 91 06 E2 D0 8D 
00112: 3E 19 D2 EF 3A A6 6F 87 46 0D 6D 82 B9 72 AF 68 
00128: C7 49 E2 43 33 BA 9A 15 32 40 6E B8 D1 07 A9 A6 
00144: 79 1E
2019-01-11 07:42:00,027 pysnmp: handle_read: transportAddress ('104.236.166.95', 161) -> ('0.0.0.0', 53950) incomingMessage (134 octets) 
00000: 30 81 83 02 01 03 30 11 02 04 00 FD FD CE 02 03 
00016: 00 FF E3 04 01 01 02 01 03 04 37 30 35 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 
00048: 02 03 0B 4A 53 04 0B 75 73 72 2D 6D 64 35 2D 64 
00064: 65 73 04 0C E3 0F D1 44 0A 77 67 79 11 A0 1F F1 
00080: 04 00 30 32 04 0E 80 00 4F B8 05 63 6C 6F 75 64 
00096: 4D AB 22 CC 04 00 A8 1E 02 01 00 02 01 00 02 01 
00112: 00 30 13 30 11 06 0A 2B 06 01 06 03 0F 01 01 02 
00128: 00 41 03 01 11 AF
2019-01-11 07:42:00,031 pysnmp: sendMessage: outgoingMessage queued (148 octets) 
00000: 30 81 91 02 01 03 30 11 02 04 00 FD FD CF 02 03 
00016: 00 FF E3 04 01 07 02 01 03 04 3F 30 3D 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 
00048: 02 03 0B 4A 53 04 0B 75 73 72 2D 6D 64 35 2D 64 
00064: 65 73 04 0C 14 50 A5 EE 1E A7 F4 51 5F 27 69 92 
00080: 04 08 00 00 00 05 2B D1 82 F6 04 38 EF DC 24 13 
00096: 0D 74 4A A6 C2 89 EF 06 84 89 B3 B8 A6 F6 46 6C 
00112: C9 BD 59 AE 36 B5 92 BA 67 80 3B 1B 4A 45 D4 BD 
00128: 46 BB 83 C6 DD D6 22 37 23 36 B6 27 CB 37 0C 34 
00144: 4F 43 75 64
2019-01-11 07:42:00,031 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x105d5a550 tagSet <TagSet object at 0x10512a550 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x105c61ba8 consts <ValueSizeConstraint object at 0x1052c3898 consts 0, 65535>, <ValueSizeConstraint object at 0x105c61b70 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (148 octets) 
00000: 30 81 91 02 01 03 30 11 02 04 00 FD FD CF 02 03 
00016: 00 FF E3 04 01 07 02 01 03 04 3F 30 3D 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 
00048: 02 03 0B 4A 53 04 0B 75 73 72 2D 6D 64 35 2D 64 
00064: 65 73 04 0C 14 50 A5 EE 1E A7 F4 51 5F 27 69 92 
00080: 04 08 00 00 00 05 2B D1 82 F6 04 38 EF DC 24 13 
00096: 0D 74 4A A6 C2 89 EF 06 84 89 B3 B8 A6 F6 46 6C 
00112: C9 BD 59 AE 36 B5 92 BA 67 80 3B 1B 4A 45 D4 BD 
00128: 46 BB 83 C6 DD D6 22 37 23 36 B6 27 CB 37 0C 34 
00144: 4F 43 75 64
2019-01-11 07:42:00,527 pysnmp: handle_read: transportAddress ('104.236.166.95', 161) -> ('0.0.0.0', 53950) incomingMessage (212 octets) 
00000: 30 81 D1 02 01 03 30 11 02 04 00 FD FD CF 02 03 
00016: 00 FF E3 04 01 03 02 01 03 04 3F 30 3D 04 0E 80 
00032: 00 4F B8 05 63 6C 6F 75 64 4D AB 22 CC 02 01 05 
00048: 02 03 0B 4A 54 04 0B 75 73 72 2D 6D 64 35 2D 64 
00064: 65 73 04 0C 14 83 BD FE 1A 87 78 B7 A1 FE DC 21 
00080: 04 08 00 00 00 05 8B D1 A2 A5 04 78 48 32 A1 D6 
00096: F7 9E A9 ED 44 8E 28 58 85 E1 7E 73 7F FA F6 B8 
00112: F9 16 3D 8B A6 32 5B 55 5E 50 18 34 23 BB 11 89 
00128: 43 47 53 C7 7F A1 79 CC 3E FA 34 31 DE F8 DE CC 
00144: 9B C5 E3 6C 51 59 6A 38 25 1D 29 60 D0 68 B9 A3 
00160: AD 31 7C 3C 9D 3D 6D A9 34 D6 35 DA EA 57 16 FD 
00176: C0 1A 13 1D 9F 4C 11 10 3A 30 95 7A 06 5A 54 82 
00192: 93 07 13 ED 0C 7F 85 B2 D6 1E D5 B8 B1 1A CF 02 
00208: 57 31 30 CE
SNMPv2-MIB::sysDescr.0 = DisplayString: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686 
AllenX01 commented 5 years ago

Maybe you're right, I change another work invironment(should be no any rules for accessing internet), It can work well. thanks for your reply.