On 14/06/07, Need Help <[EMAIL PROTECTED]> wrote: > 2) Ok, so what would my next step be to have my complete MIB tree processed > by a subagent?
Compile your MIB module code, together with the 'example-demon.c' file (or equivalent), and link them all together. > Would I need to copy the "example-demon.c" file, rename it to something like > "myOcStbHostMib-demon.c" and edit it with my specific information. You don't have to rename it (unless you specifically want to). But basically, yes. > I am > confused as to where the "example-demon.c" file came from. Was this file > created for the sole purpose of showing an example of a subagent Yes. > or must I copy this file and tweak it for use for my specific MIB? Yes. Either this file, or the equivalent code file generated by the MfD framework. > Also, it seems I would need to create a routine similiar to the > "init_nstAgentSubagentObject()" routine which can be called by the > "myOcStbHostMib-demon" subagent? You'll need an init_xxx() routine for each MIB module, yes. > DO I create a completely new ".c" file for > this and place it somewhere, or do I simply call the > "netsnmp_register_int_instance()" routine from within one > of my existing MfD code routines somewhere? This should already be generated as part of the MfD code. Just add that call to the example-demon.c (or equivalent). > I am obviously not clear how to take my existing MfD code and combine it > with some "example.c" and "nstAgentSubagentObject.c" code and get it > working. Replace the 'init_nstAgentSubagentObject()' call in example-demon.c, with calls to the init routine(s) from your MfD modules. Replace references to the nstAgentSubagentObject.X files in the Makefile with the corresponding file(s) from your MfD modules. Or you could use the Makefile/subagent code generated by mib2c/MfD and tweak them in the same way. The bottom line is that you need to compile all of the MIB code files that you're working with, and call all of the init_xxx() routines from the subagent driver. > Also will by existing container_load() and row_prep() routines be called as > normal to handle the snmp requests from the subagent or must I have to > rewrite the code somehow? I am confused how this all fits together. What > MfD code areas need to change to do this? None. As long as the subagent driving code calls the init_xxx() routine, everything else should work as usual. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders