On 2013/10/01 16:17, Reyk Floeter wrote: > Hi, > > I just committed a simple SNMP client implementation to snmpctl/snmpd. > You can use it as an in-tree alternative to net-snmp's > snmpwalk/snmpget. > > Examples: > $ snmpctl walk 127.0.0.1 > $ snmpctl walk printer.my.domain version 1 oid printerWorkingGroup > $ snmpctl -n walk 203.0.113.240 oid ifMIB community "blah" > > Limitations: > - no SNMPv3/USM support yet > - no bulk support yet (bulkwalk) > - not so many fancy options. > > snmpd does not support loading of external MIB files, so you have to > use net-snmp if you want to load additional MIBs for the symbolic name > parsing. snmpctl only shows symbolic names there are found in snmpd's > mib.h. > > Testing welcome, especially with non-snmpd(8) agents. > > Reyk >
Most things are working fine for me. v4 and v6 with opensnmpd OK (need two instances of the daemon to test this as it only opens one socket). v4 with net-snmp OK (v6 is possibly a bit broken in the net-snmp port's snmpd at present). v4 and v6 against Zyxel GS1910 (using link-local for v6) OK. Only problem I've hit so far is against D-Link DGS-1224T where snmpctl only prints the system oids, whereas net-snmp snmpwalk goes on to walk IF-MIB, TCP-MIB, UDP-MIB. system.sysDescr.0="DGS-1224T 4.21.02" system.sysOID.0=iso.org.dod.internet.private.enterprises.171.10.76.5 system.sysUpTime.0=337019590 system.sysContact.0="" system.sysName.0="ott-dlink-gig24" system.sysLocation.0="the attic" system.sysServices.0=2 <end> SNMPv2-MIB::sysDescr.0 = STRING: DGS-1224T 4.21.02 SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.171.10.76.5 SNMPv2-MIB::sysUpTime.0 = Timeticks: (337032680) 39 days, 0:12:06.80 SNMPv2-MIB::sysContact.0 = STRING: SNMPv2-MIB::sysName.0 = STRING: ott-dlink-gig24 SNMPv2-MIB::sysLocation.0 = STRING: the attic SNMPv2-MIB::sysServices.0 = INTEGER: 2 IF-MIB::ifNumber.0 = INTEGER: 25 IF-MIB::ifIndex.1 = INTEGER: 1 IF-MIB::ifIndex.2 = INTEGER: 2 IF-MIB::ifIndex.3 = INTEGER: 3 IF-MIB::ifIndex.4 = INTEGER: 4 ... <snip> 15:57:48.845525 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|30|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1aGetNextRequest(26)|02|04|02|01|02|01|30|0c |30|0a|06|06.1.3.6.1.2.1.1|05|00 (ttl 64, id 50398, len 78) 15:57:48.848682 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|66|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|4eGetResponse(78)|02|04|02|01|02|01|30|82|00|3e |30|3c|06|08.1.3.6.1.2.1.1.1.0=|04|30"DGS-1224T 4.21.02" (DF) (ttl 254, id 65014, len 134) 15:57:48.848956 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.1.0|05|00 (ttl 64, id 49660, len 80) 15:57:48.851836 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|40|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|28GetResponse(40)|02|04|02|01|02|01|30|82|00|18 |30|16|06|08.1.3.6.1.2.1.1.2.0=|06|0a.1.3.6.1.4.1.171.10.76.5 (DF) (ttl 254, id 65015, len 96) 15:57:48.851979 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.2.0|05|00 (ttl 64, id 61889, len 80) 15:57:48.854907 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|3a|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|22GetResponse(34)|02|04|02|01|02|01|30|82|00|12 |30|10|06|08.1.3.6.1.2.1.1.3.0=|43|04336972620 (DF) (ttl 254, id 65016, len 90) 15:57:48.855016 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.3.0|05|00 (ttl 64, id 30100, len 80) 15:57:48.857873 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|36|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|1eGetResponse(30)|02|04|02|01|02|01|30|82|00|0e |30|0c|06|08.1.3.6.1.2.1.1.4.0=|04|00"" (DF) (ttl 254, id 65017, len 86) 15:57:48.857983 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.4.0|05|00 (ttl 64, id 5047, len 80) 15:57:48.860909 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|45|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|2dGetResponse(45)|02|04|02|01|02|01|30|82|00|1d |30|1b|06|08.1.3.6.1.2.1.1.5.0=|04|0f"ott-dlink-gig24" (DF) (ttl 254, id 65018, len 101) 15:57:48.861018 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.5.0|05|00 (ttl 64, id 25590, len 80) 15:57:48.863971 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|3f|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|27GetResponse(39)|02|04|02|01|02|01|30|82|00|17 |30|15|06|08.1.3.6.1.2.1.1.6.0=|04|09"the attic" (DF) (ttl 254, id 65019, len 95) 15:57:48.864032 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.6.0|05|00 (ttl 64, id 19230, len 80) 15:57:48.866926 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|37|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|1fGetResponse(31)|02|04|02|01|02|01|30|82|00|0f |30|0d|06|08.1.3.6.1.2.1.1.7.0=|02|012 (DF) (ttl 254, id 65020, len 87) 15:57:48.867082 85.158.44.149.31774 > 10.15.3.2.161: [udp sum ok] |30|32|02|01|04|0fC=XXXXXXXXXXXXXXX |a1|1cGetNextRequest(28)|02|04|02|01|02|01|30|0e |30|0c|06|08.1.3.6.1.2.1.1.7.0|05|00 (ttl 64, id 30452, len 80) 15:57:48.869963 10.15.3.2.161 > 85.158.44.149.31774: [udp sum ok] |30|82|00|37|02|01|04|0fC=XXXXXXXXXXXXXXX |a2|82|00|1fGetResponse(31)|02|04|02|01|02|01|30|82|00|0f |30|0d|06|08.1.3.6.1.2.1.2.1.0=|02|0125 (DF) (ttl 254, id 65021, len 87) <stops here, no GetNextRequest for .1.3.6.1.2.1.2.1.0>
