On 12/10/14, Charles Craft wrote: > http://www.net-snmp.org/docs/man/snmpwalk.html > > "If no OID argument is present, snmpwalk will search the subtree rooted a= t > SNMPv2-SMI::mib-2 (including any MIB object values from other MIB modules= , > that are defined as lying within this subtree)." > > I think snmpwalk was doing what you asked of it in your original post. > >>> >root@RM:/home/tom# snmpwalk -On -c public -v 1 mechpboard_e > > If you add a ".1" to end of that command it should walk all branches. > > "This OID specifies which portion of the object identifier space will be > searched using GETNEXT requests." > > The getnext of this: > >.1.3.6.1.2.1.1.7.0 =3D INTEGER: 7 > will return this OID as the next to be queried so you get MIB-2 and > enterprises. > >.1.3.6.1.4.1.17095.1.1.1.0 =3D STRING: "SNMPv3Agent" > > chuckc > > > -----Original Message----- >>From: TPCpiclist@mklab.ph.rhul.ac.uk >>Sent: Dec 9, 2014 8:05 AM >>To: piclist@mit.edu >>Cc: tpcpiclist@mklab.ph.rhul.ac.uk >>Subject: Re: [PIC] Problem using Unix net-snmp tools with snmpv3_nvm_mpfs >> demo on PIC32 ESK board (part no. DM320004) [reposted with subject >> prefix] >> >>> >>> Rather than guessing, look at it from the bottom up. >>> If the Linux box has a head on it load Wireshark and its GUI there. >>> If not then capture the session with tcpdump and move the file to a >>> machine with the Wireshark GUI. >> >>I had hoped it would work out of the box and would not have to resort to >> watching the traffic on the wire. It was worth doing however. The >> 'problem' turned out to be >>the Microchip SNMP agent's variables were in different sub-trees. snmpwa= lk >> with the default options just listed the first one and stopped. The -CE >> option was needed to >>list all the available sub-tree. Specifying '-CE 2' makes it list every >> sub-tree starting with .1. Here are some samples/demos which might help >> others... >> >>tom@RM:$ snmpwalk -CE 2 -m MICROCHIP-MIB -c public -v 1 mechpboard_e >>SNMPv2-SMI::mib-2.1.1.0 =3D STRING: "Microchip Harmony" >>SNMPv2-SMI::mib-2.1.2.0 =3D OID: MICROCHIP-MIB::microchipInfo >>SNMPv2-SMI::mib-2.1.3.0 =3D Timeticks: (806010) 2:14:20.10 >>SNMPv2-SMI::mib-2.1.4.0 =3D STRING: "admin" >>SNMPv2-SMI::mib-2.1.5.0 =3D STRING: "Microchip" >>SNMPv2-SMI::mib-2.1.6.0 =3D STRING: "office" >>SNMPv2-SMI::mib-2.1.7.0 =3D INTEGER: 7 >>MICROCHIP-MIB::name.0 =3D STRING: SNMPv3Agent >>MICROCHIP-MIB::version.0 =3D STRING: v7.21 >>MICROCHIP-MIB::date.0 =3D STRING: Aug 21 2014 >>MICROCHIP-MIB::ipv4TrapReceiverNumber.0 =3D INTEGER: 0 >>MICROCHIP-MIB::ipv4TrapReceiverNumber.1 =3D INTEGER: 1 >>MICROCHIP-MIB::ipv4TrapEnabled.0 =3D INTEGER: no(0) >>MICROCHIP-MIB::ipv4TrapEnabled.1 =3D INTEGER: no(0) >>MICROCHIP-MIB::ipv4TrapReceiverIPAddress.0 =3D IpAddress: 0.0.0.0 >>MICROCHIP-MIB::ipv4TrapReceiverIPAddress.1 =3D IpAddress: 0.0.0.0 >>MICROCHIP-MIB::ipv4TrapCommunity.0 =3D STRING: >>MICROCHIP-MIB::ipv4TrapCommunity.1 =3D STRING: >>MICROCHIP-MIB::ipv6TrapReceiverNumber.0 =3D INTEGER: 0 >>MICROCHIP-MIB::ipv6TrapReceiverNumber.1 =3D INTEGER: 1 >>MICROCHIP-MIB::ipv6TrapEnabled.0 =3D INTEGER: no(0) >>MICROCHIP-MIB::ipv6TrapEnabled.1 =3D INTEGER: no(0) >>MICROCHIP-MIB::ipv6TrapReceiverIPv6Address.0 =3D STRING: 0:0:0:0:0:0:0:0 >>MICROCHIP-MIB::ipv6TrapReceiverIPv6Address.1 =3D STRING: 0:0:0:0:0:0:0:0 >>MICROCHIP-MIB::ipv6TrapCommunity.0 =3D STRING: >>MICROCHIP-MIB::ipv6TrapCommunity.1 =3D STRING: >>MICROCHIP-MIB::ledD5.0 =3D INTEGER: off(0) >>MICROCHIP-MIB::ledD6.0 =3D INTEGER: off(0) >>MICROCHIP-MIB::pushButton.0 =3D INTEGER: open(1) >>MICROCHIP-MIB::analogPot0.0 =3D INTEGER: 0 >>End of MIB >> >>tom@RM:$ snmpwalk -CE 2 -c public -v 1 mechpboard_e >>SNMPv2-MIB::sysDescr.0 =3D STRING: Microchip Harmony >>SNMPv2-MIB::sysObjectID.0 =3D OID: SNMPv2-SMI::enterprises.17095.1 >>DISMAN-EVENT-MIB::sysUpTimeInstance =3D Timeticks: (795360) 2:12:33.60 >>SNMPv2-MIB::sysContact.0 =3D STRING: admin >>SNMPv2-MIB::sysName.0 =3D STRING: Microchip >>SNMPv2-MIB::sysLocation.0 =3D STRING: office >>SNMPv2-MIB::sysServices.0 =3D INTEGER: 7 >>SNMPv2-SMI::enterprises.17095.1.1.1.0 =3D STRING: "SNMPv3Agent" >>SNMPv2-SMI::enterprises.17095.1.1.2.0 =3D STRING: "v7.21" >>SNMPv2-SMI::enterprises.17095.1.1.3.0 =3D STRING: "Aug 21 2014" >>SNMPv2-SMI::enterprises.17095.1.2.1.1.1.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.1.1 =3D INTEGER: 1 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.2.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.2.1 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.3.0 =3D IpAddress: 0.0.0.0 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.3.1 =3D IpAddress: 0.0.0.0 >>SNMPv2-SMI::enterprises.17095.1.2.1.1.4.0 =3D "" >>SNMPv2-SMI::enterprises.17095.1.2.1.1.4.1 =3D "" >>SNMPv2-SMI::enterprises.17095.1.2.2.1.1.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.1.1 =3D INTEGER: 1 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.2.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.2.1 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.3.0 =3D Hex-STRING: 00 00 00 00 00 = 00 >> 00 00 00 00 00 00 00 00 00 00 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.3.1 =3D Hex-STRING: 00 00 00 00 00 = 00 >> 00 00 00 00 00 00 00 00 00 00 >>SNMPv2-SMI::enterprises.17095.1.2.2.1.4.0 =3D "" >>SNMPv2-SMI::enterprises.17095.1.2.2.1.4.1 =3D "" >>SNMPv2-SMI::enterprises.17095.1.3.1.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.3.2.0 =3D INTEGER: 0 >>SNMPv2-SMI::enterprises.17095.1.3.3.0 =3D INTEGER: 1 >>SNMPv2-SMI::enterprises.17095.1.3.4.0 =3D INTEGER: 0 >>End of MIB >> >>tom@RM:$ snmpwalk -On -CE 2 -c public -v 1 mechpboard_e >>.1.3.6.1.2.1.1.1.0 =3D STRING: Microchip Harmony >>.1.3.6.1.2.1.1.2.0 =3D OID: .1.3.6.1.4.1.17095.1 >>.1.3.6.1.2.1.1.3.0 =3D Timeticks: (810225) 2:15:02.25 >>.1.3.6.1.2.1.1.4.0 =3D STRING: admin >>.1.3.6.1.2.1.1.5.0 =3D STRING: Microchip >>.1.3.6.1.2.1.1.6.0 =3D STRING: office >>.1.3.6.1.2.1.1.7.0 =3D INTEGER: 7 >>.1.3.6.1.4.1.17095.1.1.1.0 =3D STRING: "SNMPv3Agent" >>.1.3.6.1.4.1.17095.1.1.2.0 =3D STRING: "v7.21" >>.1.3.6.1.4.1.17095.1.1.3.0 =3D STRING: "Aug 21 2014" >>.1.3.6.1.4.1.17095.1.2.1.1.1.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.1.1.1.1 =3D INTEGER: 1 >>.1.3.6.1.4.1.17095.1.2.1.1.2.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.1.1.2.1 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.1.1.3.0 =3D IpAddress: 0.0.0.0 >>.1.3.6.1.4.1.17095.1.2.1.1.3.1 =3D IpAddress: 0.0.0.0 >>.1.3.6.1.4.1.17095.1.2.1.1.4.0 =3D "" >>.1.3.6.1.4.1.17095.1.2.1.1.4.1 =3D "" >>.1.3.6.1.4.1.17095.1.2.2.1.1.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.2.1.1.1 =3D INTEGER: 1 >>.1.3.6.1.4.1.17095.1.2.2.1.2.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.2.1.2.1 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.2.2.1.3.0 =3D Hex-STRING: 00 00 00 00 00 00 00 00 00= 00 >> 00 00 00 00 00 00 >>.1.3.6.1.4.1.17095.1.2.2.1.3.1 =3D Hex-STRING: 00 00 00 00 00 00 00 00 00= 00 >> 00 00 00 00 00 00 >>.1.3.6.1.4.1.17095.1.2.2.1.4.0 =3D "" >>.1.3.6.1.4.1.17095.1.2.2.1.4.1 =3D "" >>.1.3.6.1.4.1.17095.1.3.1.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.3.2.0 =3D INTEGER: 0 >>.1.3.6.1.4.1.17095.1.3.3.0 =3D INTEGER: 1 >>.1.3.6.1.4.1.17095.1.3.4.0 =3D INTEGER: 0 >>End of MIB >> >>Here are some examples reading the ESK board's push-button, >> >>tom@RM:$ snmpget -v 1 -c public mechpboard_e MICROCHIP-MIB::pushButton.0 >> # Read pushButton0 in normal state >>MICROCHIP-MIB::pushButton.0 =3D INTEGER: open(1) >>tom@RM:$ # Depress Switch SW1 >>tom@RM:$ snmpget -v 1 -c public mechpboard_e MICROCHIP-MIB::pushButton.0 >> # Read pushButton0 in activated state >>MICROCHIP-MIB::pushButton.0 =3D INTEGER: closed(0) >> >>tom@RM:$ snmpget -On -v 1 -c public mechpboard_e >> MICROCHIP-MIB::pushButton.0 # Read pushButton0 in normal state, us= e >> -On to get its OID >>.1.3.6.1.4.1.17095.1.3.3.0 =3D INTEGER: open(1) >>tom@RM:$ snmpget -v 1 -c public mechpboard_e .1.3.6.1.4.1.17095.1.3.3.0 >> # Read pushButton0 in normal state using OID >>SNMPv2-SMI::enterprises.17095.1.3.3.0 =3D INTEGER: 1 >>tom@RM:$ # Depressing pushButton0... >>tom@RM:$ snmpget -On -v 1 -c public mechpboard_e >> MICROCHIP-MIB::pushButton.0 # Read pushButton0 in activated state >>.1.3.6.1.4.1.17095.1.3.3.0 =3D INTEGER: closed(0) >>tom@RM:$ snmpget -v 1 -c public mechpboard_e .1.3.6.1.4.1.17095.1.3.3.0 >> # Read pushButton0 in activated state using OID >>SNMPv2-SMI::enterprises.17095.1.3.3.0 =3D INTEGER: 0 >> >>My thanks to all who replied, inc. directly by email. >> >>Tom Crane. >> >> >> >>> >>> >>> >>> -----Original Message----- >>> >From: TPCpiclist@mklab.ph.rhul.ac.uk >>> >Sent: Dec 3, 2014 11:17 AM >>> >To: piclist@mit.edu >>> >Cc: tpcpiclist@mklab.ph.rhul.ac.uk >>> >Subject: [PIC] Problem using Unix net-snmp tools with snmpv3_nvm_mpfs >>> > demo on PIC32 ESK board (part no. DM320004) [reposted with subject >>> > prefix] >>> > >>> >Dear All, >>> > I am attempting to create a device running an SNMP agent. As = a >>> > >>> >start I have built the snmpv3_nvm_mpfs demo app under MPLAB Harmony an= d >>> > >>> >can access its web and SNMP interfaces. With the device connected to = a >>> > >>> >dual boot PC, under Windows 7 I can properly interrogate the SNMP agen= t >>> > >>> >using the iReasoning browser recommenced by Microchip in the MPLAB >>> > Harmony >>> >documentation. In particular I can read the push-button status and tu= rn >>> > >>> >the board's LEDs on and off. >>> > >>> >Under Linux, using the snmpwalk, snmpget & snmpset command line tools >>> >there are problems. Snmpwalk returns only a small fraction of the >>> > agent's >>> >name-space, eg. >>> > >>> >root@RM:/home/tom# snmpwalk -On -c public -v 1 mechpboard_e >>> >.1.3.6.1.2.1.1.1.0 =3D STRING: Microchip Harmony >>> >.1.3.6.1.2.1.1.2.0 =3D OID: .1.3.6.1.4.1.17095.1 >>> >.1.3.6.1.2.1.1.3.0 =3D Timeticks: (60130) 0:10:01.30 >>> >.1.3.6.1.2.1.1.4.0 =3D STRING: admin >>> >.1.3.6.1.2.1.1.5.0 =3D STRING: Microchip >>> >.1.3.6.1.2.1.1.6.0 =3D STRING: office >>> >.1.3.6.1.2.1.1.7.0 =3D INTEGER: 7 >>> > >>> >Specifying the OID reported by the iReasoning browser running under >>> >Windows for one of the board's LEDs with snmpset; or a push-button usi= ng >>> > >>> >snmpget always fails. >>> > >>> >I also tried the net-snmp toolkit's tkmib browser which loops with an >>> >error and again does not find the agent's LED or push-button hardware. >>> > >>> >I have copied the mchip.mib and snmp.mib MIB files into (at different >>> >times) both /usr/share/snmp/mibs/ and ~/.snmp/mibs but without effect. >>> > >>> >Similarly specifying SNMP v1 or v2c on the command line makes no >>> >difference. >>> > >>> >I really don't want to be tied to Windows for development and more >>> >importantly I need the device to work with the Unix or any other SNMP >>> >client. Can anyone explain what might be wrong or supply working >>> > examples >>> >of net-snmp commands to access the board's push-button/LEDs? Please l= et >>> > >>> >me know if I've omitted anything pertinent. >>> > >>> >Many thanks >>> >Tom Crane >>> > >>> > >>> >Linux system details: >>> > Distro: Slackware current >>> > Architecture: i686 >>> > Kernel: 3.14.12 >>> > IDE: MPLAB IDE v2.20 >>> > MPLAB Harmony framework: v1.00 >>> > PIC Compiler: XC32 (v1.33) [free download] >>> > >>> >Apologies for the earlier subject prefix-less post. >>> >-- >>> >Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham >>> > Hill, >>> >Egham, Surrey, TW20 0EX, England. >>> >Email: T.Crane@rhul.ac.uk >>> >Fax: +44 (0) 1784 472794 >>> >-- >>> >http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >>> >View/change your membership options at >>> >http://mailman.mit.edu/mailman/listinfo/piclist >>> >>> >>> >>> -- >>> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >>> View/change your membership options at >>> http://mailman.mit.edu/mailman/listinfo/piclist >>> >> >> >>-- >>Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham >> Hill, >>Egham, Surrey, TW20 0EX, England. >>Email: T.Crane@rhul.ac.uk >>Fax: +44 (0) 1784 472794 >>-- >>http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >>View/change your membership options at >>http://mailman.mit.edu/mailman/listinfo/piclist > > > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .