Re: SNMP variable length string support
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 30/10/2007, thommandra gowtham <[email protected]> wrote: > I have a question on SNMP variable length string support. Suppose a MIB > contains..... > LinkName ::= OCTET STRING (SIZE(1..8)) > demoEntryString OBJECT-TYPE > SYNTAX LinkName ..... > ::= {demoEntry 2} > demoEntry OBJECT-TYPE : > INDEX {demoEntryString} > ::= {demoTable 1} > What would be the output of snmpget, snmpwalk and snmpgetnext commands on > the above demotable? I presume you are talking about the Solstice Enterprise Agent DEMO-MIB here? (You don't actually say, and it's definitely not one of ours). With those tweaks, and a single row indexed by the string "hello", then the results of walking the table would look something like: DEMO-MIB::demoEntryInteger."hello" = down(2) DEMO-MIB::demoEntryOid."hello" = SNMPv2-SMI::zeroDotZero or using numeric OIDs: .1.3.6.1.4.1.42.1000.10.1.3.5.104.101.108.108.111 = INTEGER: 2 .1.3.6.1.4.1.42.1000.10.1.4.5.104.101.108.108.111 = OBJECT ID: .0.0 The instance subidentifiers (i.e. the index) are 5 (the length of the string), followed by the ascii values of the individual characters 104 ('h'), 101 ('e'), 108 ('l', twice), and 111 ('o'). If the definition of LinkName had been LinkName::= OCTET STRING (SIZE(8)) (i.e. a fixed size), then the length subidentifier isn't needed, and the response would have been something like .1.3.6.1.4.1.42.1000.10.1.3.103.111.111.100.98.121.101.33 = INTEGER: 2 .1.3.6.1.4.1.42.1000.10.1.4.103.111.111.100.98.121.101.33 = OBJECT ID: .0.0 OK? Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users