in reply to Storing a tied hash of SNMP

In the POD for SNMP, it says:

a tied hash to access parsed MIB information. After the MIB has been loaded this hash allows access to to the parsed in MIB meta-data(the structure of the MIB (i.e., schema)). The hash returns blessed references to SNMP::MIB::NODE objects which represent a single MIB attribute. The nodes can be fetched with multiple 'key' formats - the leaf name (e.g.,sysDescr) or fully/partially qualified name (e.g., system.sysDescr) or fully qualified numeric OID. The returned node object supports the following fields...

Does that help you?

Replies are listed 'Best First'.
Re^2: Storing a tied hash of SNMP
by linxdev (Sexton) on Feb 24, 2016 at 22:16 UTC
    Unfortunately Storable::nstore(\%SNMP::MIB) 'file' does not work, which is what I was trying to do.

    Instead I've been parsing the SNMP::MIB::NODE objects and converting them to a SQLite DB file. This is working very well.

    100 tests: T1 is using SNMP::MIB after calling SNMP::initMib(). T2 is using a SQLite DB in a squased FS. T3 is using the same file in ram

    Totals : 685.29 74.02 74.42 Average T1: 6.8529 Average T2: 0.74 Average T3: 0.74

    As you can see, using initMib and then converting 60k of SNMP objects to a DB file took me from aprox 7s down to 1s. Storeable may actually be slower.

      I was looking at the tie'd interface and it might be worth trying to extend a STORE so that it also writes to a file or database. YMMV, but all of this tie'd stuff seems like terrible core for such a module.