[ Sorry for the delay in responding to this ] > I want to take an existing database and create a MIB from it, > then run mib2c and generate stubs for the SNMP agent. > > Inside the stubs, I'll make the appropriate calls to retrieve the data > from the database. > > Does such a handy thing exist?
There's not an existing mib2c config for this, no. That shouldn't be too difficult for implementing GET requests, but things are likely to be a bit more complicated for GETNEXT. If the number of rows (and their indexes) are reasonably static, then you should be able to use the 'table_data' (or 'table_container') helper reasonably naturally - load the helper with information about which rows currently exist, and then query the database for the appropriate row in the user-provided handler. The agent helpers will take care of working out which row is needed for each request. If the number of rows and/or indexing keeps changing, then this needs to be handled differently. You might be better off looking at the iterator helper, to walk through the rows of the database. If you're happy to cache the data within the agent, then Robert's MfD structure might be worth a look instead. Dave ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ 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