1) You reference a "MIB module" in your descriptions. Does the term "MIB
module" refer to "all" the files generated by the mib2c(MfD configuration)
tool? I mean, there are many files produced for a particular table, so I
wanted to make sure what "MIB Module" really meant. Possibly it means "all
files" generated for a particular Table or Scalar?
2) I asked you whether I should copy and tweak the "example-demon.c" file and
you stated:
"Yes. Either this file, or the equivalent code file generated by the MfD
framework".
What do you mean "equivalent code file generated by the MfD framework"? Is
there some specific file generated for me? Perhaps you are refering to a file
which is created as a result of running mib2c with the MfD configuration when
the "generate Makefile/AgentX code" option has been selected?
3) When using the mib2c with the MfD configuration file to generate code, I
thought the "generate Makefile/AgentX code" option was used to generate a
"Makefile" and some other code (ie: "ocStbHostAVInterfaceTable_subagent.c")
which allowed me to test the Table's functionality locally (with a specialized
agent) instead of having to run the snmpd master agent.
Are you recommending that I could generate all of my mib2c(MfD) code with the
"generate Makefile/AgentX code" option selected so I could update the
"Makefile" and code file (ie: "ocStbHostAVInterfaceTable_subagent.c") with the
changes
required to compile and link everything? If I did this then I would be
producing a subagent for each Table/Scaler defined in my MIB and this does not
sound correct .... do you agree?
4) I have the following 2 tables and 1 scalar defined in my MIB text file.
There are actually many more tables and scalars defined in my MIB, but lets
reference these only:
ocStbHostAVInterfaceTable (Table1)
ocStbHostAnalogVideoTable (Table2)
ocStbHostHWIdentifiers (Scalar)
I ran mib2c(MfD conf) to generate code for each of the tables and scalars and
the code is located in the "/agent/mibgroup/OC-STB-HOST-MIB/" directory in the
following subdirectory locations:
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable.c
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_access.c
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_access.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_get.c
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_get.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_set.c
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_data_set.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_enums.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_interface.c
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_interface.h
/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable_oids.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable.c
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_access.c
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_access.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_get.c
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_get.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_set.c
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_data_set.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_enums.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_interface.c
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_interface.h
/ocStbHostAnalogVideoTable/ocStbHostAnalogVideoTable_oids.h
/ocStbHostHWIdentifiers/ocStbHostHWIdentifiers.c
/ocStbHostHWIdentifiers/ocStbHostHWIdentifiers.h
In the "ocStbHostAVInterfaceTable.c", "ocStbHostAnalogVideoTable.c" and
"ocStbHostHWIdentifiers.c" files, the following routines are defined:
void init_ocStbHostAVInterfaceTable(void)
void init_ocStbHostAnalogVideoTable(void)
void init_ocStbHostHWIdentifiers(void)
Are you indicating these three "init" routines each should call the
"netsnmp_register_int_instance()" routine and that each of these "init"
routines should be called from within the "example-demon.c" file?
5) I was planning on putting the "example-demon.c" module into the following
location:
/agent/mibgroup/OC-STB-HOST-MIB/example-demon.c
Is this a good place for the file to be lcoated? All "subdirectories" located
within the "/agent/mibgroup/OC-STB-HOST-MIB/" directory are used for specific
tables and scalars so I thought if the "example-demon.c" file was located
within the "/agent/mibgroup/OC-STB-HOST-MIB" directory then that would be best.
Does this make sense?
6) To compile and link the "example-demon.c" file with all my other MIB files,
which file do I need to update? Perhaps it would be the
"/agent/mibgroup/Makefile" file ..... perhaps other files as well? Also, what
do I
need to change in there to get it compiling and linking together?
** Yes, I am new to the Linux environment ..... so I do not want to screw
anything up.
7) Just to confirm for myself .......
I only need ONE "example-demon.c" type file to exist and this file will call an
"init" function for each one of my Tables and Scalars defined in my MIB? Is
this correct?
***** THANK YOU for all your help and patience. I am learning tons and really
appreciate your effort.
Dave Shield <[EMAIL PROTECTED]> wrote: On 14/06/07, Need Help 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
---------------------------------
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get online.
-------------------------------------------------------------------------
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