Open maddingue opened 11 years ago
And, while trying to replicate this, it succeeded in answering the client. Once.
### $ snmpget -v2c -c public localhost .1.3.6.1.4.1.32272.1
### SNMPv2-SMI::enterprises.32272.1 = STRING: "hello"
Received 44 byte packet from UDP: [127.0.0.1]:36851->[127.0.0.1]:161
0000: 30 2A 02 01 01 04 06 70 75 62 6C 69 63 A0 1D 02 0*.....public...
0016: 04 41 E6 10 59 02 01 00 02 01 00 30 0F 30 0D 06 .A..Y......0.0..
0032: 09 2B 06 01 04 01 81 FC 10 01 05 00 .+..........
Received SNMP packet(s) from UDP: [127.0.0.1]:36851->[127.0.0.1]:161
GET message
-- SNMPv2-SMI::enterprises.32272.1
Sending 40 bytes to Local IPC: abstract
0000: 01 05 00 00 05 00 00 00 01 00 00 00 02 00 00 00 ................
0016: 14 00 00 00 03 04 00 00 01 00 00 00 10 7E 00 00 .............~..
0032: 01 00 00 00 00 00 00 00 ........
Received 60 byte packet from Local IPC: /opt/snmp/5.7.2/var/agentx/master
0000: 01 12 00 00 05 00 00 00 01 00 00 00 02 00 00 00 ................
0016: 28 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 (...............
0032: 03 04 00 00 01 00 00 00 10 7E 00 00 01 00 00 00 .........~......
0048: 05 00 00 00 68 65 6C 6C 6F 00 00 00 ....hello...
Sending 49 bytes to UDP: [127.0.0.1]:36851->[127.0.0.1]:161
0000: 30 2F 02 01 01 04 06 70 75 62 6C 69 63 A2 22 02 0/.....public.".
0016: 04 41 E6 10 59 02 01 00 02 01 00 30 14 30 12 06 .A..Y......0.0..
0032: 09 2B 06 01 04 01 81 FC 10 01 04 05 68 65 6C 6C .+..........hell
0048: 6F o
While giving a new shot at this, I was surprised to find that the module does not work when AnyEvent selects EV as backend loop: it somehow hangs in epoll(), and the timers never get called.
The module correctly connects to the AgentX socket, but as soon as one tries to snmpget/walk the registered OIDs, it seems there's a communication problem between snmpd and the Perl agent, diagnosed by the message "AgentX master disconnected us, reconnecting in 15" on agent side, and the message "Timeout: No Response from localhost." on client side.