On 7 February 2012 12:23, Siuli Roy <siuli....@gmail.com> wrote: > I am new to snmp and looking for some help to implement a table which is not > static i.e., table needs to be built dynamically each time a get command is > issued.
No - you probably do *not* want to rebuild the table for every individual GET. Remember that there is no such thing as a "GetTable" request in SNMP. When walking a table, each individual element will be the subject of a separate GetNext request. You don't want to be loading the table from scratch every single time! [OK - there's also a GetBulk request which goes some way towards mitigating this. But the basic concept still holds - reloading the full table on each incoming request is a Bad Idea] > Can you please help me in this regard? The normal technique here is to use a locally cached version of the table. When a request comes in, it will normally use this internal cache to process the request. It's only when the cache is regarded as "too old" that the agent will reload the table data. How old is "too old" is entirely up to you, but would normally be taken as just long enough to walk the whole table. You might have to do some experimenting, depending on the size of the table (i.e. number of rows and columns), and how fast the data is changing. But I'd probably start with a timeout of 5s or so, and tweak this in the light of experience. > I was trying mib2c iterate > conf but > it is not allowing us to retrieve updated data. Which mib2c configuration > file will be suitable for this? Pretty much all of the table frameworks support this sort of cache mechanism. The iterate template will include the necessary code if you invoke it as mib2c -Scache=1 -c mib2c.iterate.conf myTable My personal preference would be to use mib2c -Scache=1 -c mib2c.table_data.conf myTable instead, which is similar but has a more efficient way of handling the internal table. Alternatively, you could use the MfD framework (mib2c.mfd.conf) which is intended to handle as much of the processing as possible automatically. Personally I find this code less easy to work with, so leave everything to do with that approach to others, but it's a possibility and does support the same sort of caching mechanism. Dave ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users