Hello coders,

Please, do anyone have a functional source created with *
mib2c.table_data.conf* that makes use of* netsnmp_cache_create()* to cache a
table after reading data from a file?

Here's a code snippet from the source generated by *mib2c*:

int
myTable_load (netsnmp_cache * cache, void *vmagic)
{
  netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
  netsnmp_tdata_row *row;
  FILE *fp;
  char buf[STRMAX];
  fp = fopen ("/data/for/myDatabaseTable", "r");

  while (fgets (buf, STRMAX, fp))
    {
    /*
    * Unpick 'buf' to extract the index values...
    */
      this = myTable_createEntry(table, myId);
    /*
    * ... and then populate 'this' with the column values
    */
    }
  fclose (fp);
}

Thanks in advance.

Best Regards,

-- 
Rodrigo Hjort
www.hjort.co
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to