Searching \ for '[PIC] Problem using Unix net-snmp tools with snmpv' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Problem using Unix net-snmp tools with snmpv'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Problem using Unix net-snmp tools with snmpv'
2014\12\03@111708 by TPCpiclistn/a

flavicon
face
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 and 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 agent using the iReasoning browser recommenced by Microchip in the MPLAB Harmony documentation.  In particular I can read the push-button status and turn 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 = STRING: Microchip Harmony
..1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.17095.1
..1.3.6.1.2.1.1.3.0 = Timeticks: (60130) 0:10:01.30
..1.3.6.1.2.1.1.4.0 = STRING: admin
..1.3.6.1.2.1.1.5.0 = STRING: Microchip
..1.3.6.1.2.1.1.6.0 = STRING: office
..1.3.6.1.2.1.1.7.0 = 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 using 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 let 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:  spam_OUTT.CraneTakeThisOuTspamrhul.ac.uk
Fax:    +44 (0) 1784 472794
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2014\12\03@112822 by alan.b.pearce

face picon face
Tag added ...

{Quote hidden}

-- Scanned by iCritical.

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2014\12\03@113652 by Charles Craft

picon face
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.



{Original Message removed}

2014\12\09@080527 by TPCpiclistn/a

flavicon
face
>
> 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.  snmpwalk 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 = STRING: "Microchip Harmony"
SNMPv2-SMI::mib-2.1.2.0 = OID: MICROCHIP-MIB::microchipInfo
SNMPv2-SMI::mib-2.1.3.0 = Timeticks: (806010) 2:14:20.10
SNMPv2-SMI::mib-2.1.4.0 = STRING: "admin"
SNMPv2-SMI::mib-2.1.5.0 = STRING: "Microchip"
SNMPv2-SMI::mib-2.1.6.0 = STRING: "office"
SNMPv2-SMI::mib-2.1.7.0 = INTEGER: 7
MICROCHIP-MIB::name.0 = STRING: SNMPv3Agent
MICROCHIP-MIB::version.0 = STRING: v7.21
MICROCHIP-MIB::date.0 = STRING: Aug 21 2014
MICROCHIP-MIB::ipv4TrapReceiverNumber.0 = INTEGER: 0
MICROCHIP-MIB::ipv4TrapReceiverNumber.1 = INTEGER: 1
MICROCHIP-MIB::ipv4TrapEnabled.0 = INTEGER: no(0)
MICROCHIP-MIB::ipv4TrapEnabled.1 = INTEGER: no(0)
MICROCHIP-MIB::ipv4TrapReceiverIPAddress.0 = IpAddress: 0.0.0.0
MICROCHIP-MIB::ipv4TrapReceiverIPAddress.1 = IpAddress: 0.0.0.0
MICROCHIP-MIB::ipv4TrapCommunity.0 = STRING:
MICROCHIP-MIB::ipv4TrapCommunity.1 = STRING:
MICROCHIP-MIB::ipv6TrapReceiverNumber.0 = INTEGER: 0
MICROCHIP-MIB::ipv6TrapReceiverNumber.1 = INTEGER: 1
MICROCHIP-MIB::ipv6TrapEnabled.0 = INTEGER: no(0)
MICROCHIP-MIB::ipv6TrapEnabled.1 = INTEGER: no(0)
MICROCHIP-MIB::ipv6TrapReceiverIPv6Address.0 = STRING: 0:0:0:0:0:0:0:0
MICROCHIP-MIB::ipv6TrapReceiverIPv6Address.1 = STRING: 0:0:0:0:0:0:0:0
MICROCHIP-MIB::ipv6TrapCommunity.0 = STRING:
MICROCHIP-MIB::ipv6TrapCommunity.1 = STRING:
MICROCHIP-MIB::ledD5.0 = INTEGER: off(0)
MICROCHIP-MIB::ledD6.0 = INTEGER: off(0)
MICROCHIP-MIB::pushButton.0 = INTEGER: open(1)
MICROCHIP-MIB::analogPot0.0 = INTEGER: 0
End of MIB

tom@RM:$ snmpwalk -CE 2 -c public -v 1 mechpboard_e
SNMPv2-MIB::sysDescr.0 = STRING: Microchip Harmony
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.17095.1
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (795360) 2:12:33.60
SNMPv2-MIB::sysContact.0 = STRING: admin
SNMPv2-MIB::sysName.0 = STRING: Microchip
SNMPv2-MIB::sysLocation.0 = STRING: office
SNMPv2-MIB::sysServices.0 = INTEGER: 7
SNMPv2-SMI::enterprises.17095.1.1.1.0 = STRING: "SNMPv3Agent"
SNMPv2-SMI::enterprises.17095.1.1.2.0 = STRING: "v7.21"
SNMPv2-SMI::enterprises.17095.1.1.3.0 = STRING: "Aug 21 2014"
SNMPv2-SMI::enterprises.17095.1.2.1.1.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.1.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.17095.1.2.1.1.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.1.1.2.1 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.1.1.3.0 = IpAddress: 0.0.0.0
SNMPv2-SMI::enterprises.17095.1.2.1.1.3.1 = IpAddress: 0.0.0.0
SNMPv2-SMI::enterprises.17095.1.2.1.1.4.0 = ""
SNMPv2-SMI::enterprises.17095.1.2.1.1.4.1 = ""
SNMPv2-SMI::enterprises.17095.1.2.2.1.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.17095.1.2.2.1.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.2.1.2.1 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.2.2.1.3.0 = 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 = 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 = ""
SNMPv2-SMI::enterprises.17095.1.2.2.1.4.1 = ""
SNMPv2-SMI::enterprises.17095.1.3.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.3.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.17095.1.3.3.0 = INTEGER: 1
SNMPv2-SMI::enterprises.17095.1.3.4.0 = 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 = STRING: Microchip Harmony
..1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.17095.1
..1.3.6.1.2.1.1.3.0 = Timeticks: (810225) 2:15:02.25
..1.3.6.1.2.1.1.4.0 = STRING: admin
..1.3.6.1.2.1.1.5.0 = STRING: Microchip
..1.3.6.1.2.1.1.6.0 = STRING: office
..1.3.6.1.2.1.1.7.0 = INTEGER: 7
..1.3.6.1.4.1.17095.1.1.1.0 = STRING: "SNMPv3Agent"
..1.3.6.1.4.1.17095.1.1.2.0 = STRING: "v7.21"
..1.3.6.1.4.1.17095.1.1.3.0 = STRING: "Aug 21 2014"
..1.3.6.1.4.1.17095.1.2.1.1.1.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.1.1.1.1 = INTEGER: 1
..1.3.6.1.4.1.17095.1.2.1.1.2.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.1.1.2.1 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.1.1.3.0 = IpAddress: 0.0.0.0
..1.3.6.1.4.1.17095.1.2.1.1.3.1 = IpAddress: 0.0.0.0
..1.3.6.1.4.1.17095.1.2.1.1.4.0 = ""
..1.3.6.1.4.1.17095.1.2.1.1.4.1 = ""
..1.3.6.1.4.1.17095.1.2.2.1.1.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.2.1.1.1 = INTEGER: 1
..1.3.6.1.4.1.17095.1.2.2.1.2.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.2.1.2.1 = INTEGER: 0
..1.3.6.1.4.1.17095.1.2.2.1.3.0 = 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 = 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 = ""
..1.3.6.1.4.1.17095.1.2.2.1.4.1 = ""
..1.3.6.1.4.1.17095.1.3.1.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.3.2.0 = INTEGER: 0
..1.3.6.1.4.1.17095.1.3.3.0 = INTEGER: 1
..1.3.6.1.4.1.17095.1.3.4.0 = 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 = 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 = INTEGER: closed(0)

tom@RM:$ snmpget -On -v 1 -c public mechpboard_e MICROCHIP-MIB::pushButton.0       # Read pushButton0 in normal state, use -On to get its OID
..1.3.6.1.4.1.17095.1.3.3.0 = 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 = 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 = 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 = INTEGER: 0

My thanks to all who replied, inc. directly by email.

Tom Crane.



>
>
>
> {Original Message removed}

2014\12\09@090545 by Charles Craft

picon face
www.net-snmp.org/docs/man/snmpwalk.html

"If no OID argument is present, snmpwalk will search the subtree rooted at 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 = 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 = STRING: "SNMPv3Agent"

chuckc


{Original Message removed}

2014\12\09@093936 by Lyle Hazelwood

picon face
On 12/10/14, Charles Craft <@spam@chuckseaKILLspamspammindspring.com> wrote:
{Quote hidden}

> {Original Message removed}

2014\12\11@202622 by TPCpiclistn/a

flavicon
face
>
> http://www.net-snmp.org/docs/man/snmpwalk.html
>
> "If no OID argument is present, snmpwalk will search the subtree rooted at 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 = 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 = STRING: "SNMPv3Agent"
>
> chuckc

Many thanks for the clarification.
Tom.

[ cut]

-- Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill,
Egham, Surrey, TW20 0EX, England. Email:  KILLspamT.CraneKILLspamspamrhul.ac.uk
Fax:    +44 (0) 1784 472794
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

More... (looser matching)
- Last day of these posts
- In 2014 , 2015 only
- Today
- New search...