Re: Row operation in Net-SNMP
Fulko Hew <[email protected]>
| Newsgroups | gmane.network.net-snmp.devel,gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CAGuV3hNKw5OiRFzuhV+FF6mH7B+g-eYpzyy6VW_cOBtsUj+9FA@mail.gmail.com> |
On Thu, Apr 25, 2013 at 11:14 PM, Zheng, Wenjie (Barclay) < [email protected]> wrote: > Hi Fulko**** > > ** ** > > Thanks for your response.**** > > Do you have any good examples or suggestions on how I can itorate the > table in Getbulk operation in row instead of column? > You can't.. Traversing an OID tree happens in lexicographical order, and so would getbulk. The only way to traverse a row (rather than a column) is to do it yourself (assuming you know what columns you want to get. **** > > ** ** > > Thanks,**** > > Barclay**** > > ** ** > ------------------------------ > > *From:* Fulko Hew [mailto:[email protected]] > *Sent:* 2013年4月24日 20:22 > *To:* Zheng, Wenjie (Barclay) > *Cc:* Dave Shield; [email protected]; > [email protected] > *Subject:* Re: Row operation in Net-SNMP**** > > ** ** > > ** ** > > On Wed, Apr 24, 2013 at 2:02 AM, Zheng, Wenjie (Barclay) < > [email protected]> wrote:**** > > Hi, Dave et al, > > I have a puzzle of Net-SNMP table operation, for example I have a table > like below: > > a1-a2-a3-a4 > b1-b2-b3-b4 > c1-c2-c3-c4 > > In net-snmp, if I use iterator helper to implement the table handler, it > will translate the getbulk request to bunch of get request, the order is: > a1->b1->c1->a2->b2->c2..... > > So it's first column then send column and so on. In my case, the data is > stored ourside in row order, like first row, second row. > a1->a2->a3->a4->b1->b2....**** > > > The iterator, just like the definition of how getNext() works, is: > it follows OIDs 'in order'; and OIDs define entries as: > > table.column.index... > > So the indexes are all traversed first ... before it 'backs up' to go to > the next column > ... before it goes to the next table... etc. > **** > > I can read the whole row one time, and then return all the values for the > whole row. Then I only need read outside data 3 times for the whole table. > But in the iterator helper, I will need to read outside data 12 times for > the whole table.**** > > > That is indeed what you need to do if you want to optimize/minimize the > number of > transactions on the network. **** > > ** ** > ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders