________________________________
From: Wes Hardaker <[email protected]>
To: sujata patra <[email protected]>
Cc: Wes Hardaker <[email protected]>;
[email protected]
Sent: Wed, December 22, 2010 10:05:34 AM
Subject: Re: doubt in nested table implementation
>>>>> On Tue, 21 Dec 2010 20:15:12 -0800 (PST), sujata patra
>>>>><[email protected]> said:
sp> Thanks Wes. That's right . I have got it now and able to progress . I was
sp> confused whether to make tree structure .
Tree structures are not supported by SMIv2 (the MIB language). If
you're getting the point of needing to do that it's probably time to
pick up a book on good mib design ("Understanding SNMP MIBs" is a good one).
I understood from the MIB point . They are table . index are referenced to
first table
msgVMEntry OBJECT-TYPE
SYNTAX MsgVMEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Virtual Machine"
INDEX { messageIndex, msgVMIndex }
::= { msgVMTable 1 }
But the actual data hierarchical in nature . For each row of data in the first
table , there are multiple rows of data( which is 2nd table).
Issue I am facing is an implementation issue. Data are stored in a tree . I
understood that while implementing, 2nd table table data will be indexed with
combination of first table row and the 2nd table row.
My doubt
-------------------
While refreshing the data or loading for the first time , Do I have to load the
whole tree data to all the tables ?
here messageTable_load needs to load its own rows as well as its child tables.
netsnmp_inject_handler_before( reg,
netsnmp_get_cache_handler(MESSAGETABLE_TIMEOUT,
messageTable_load, messageTable_free,
messageTable_oid, messageTable_oid_len),
TABLE_ITERATOR_NAME);
2nd/lower level table might not require the following . any thing wrong in my
understanding ?
netsnmp_inject_handler_before( reg,
netsnmp_get_cache_handler(MSGVMTABLE_TIMEOUT,
msgVMTable_load, msgVMTable_free,
msgVMTable_oid, msgVMTable_oid_len),
TABLE_ITERATOR_NAME);
Similarly If I do not use the cache , I have to register an alarm for all the
tables( reads the whole tree data and translates the data in multiple table)
snmp_alarm_register( 5, SA_REPEAT ,update_all_stats, NULL );
update_all_stats translates the whole tree data in to multiple tables. Am I
right ?
If I like to partially update or refresh the data , let 's say only for the
second table , how can I do this ? I think I am missing some pointers here .
Can you help me in this point ?
sp> This is basically making the tree to linear array by storing the
sp> indexes of each parent/grand parent node. right ?
If you're familiar with relational databases, MIBs follow similar
concepts. The topic is much longer than I can explain quickly over
mail, so I suggest you either read a good book or read the RFC itself
(RFC2578).
sp> I have added all the columns.
sp> netsnmp_table_helper_add_indexes(table_info,
The only columns you should add are the indexes. The rest of them
shouldn't be there.
--
Wes Hardaker
Please mail all replies to [email protected]
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders