On 14/06/07, Need Help <[EMAIL PROTECTED]> wrote:
> 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?

Yes.

I have the (perhaps unwise) habit of using the term "MIB module" to mean
"the code that implements a chunk of MIB objects".   Which is deliberately
somewhat vague.
   This could mean a single MIB table, a group of scalar objects, several
related tables, etc, etc.   Basically, all the code files related to a
set of MIB
objects that you want to consider as a single bundle.


>  Possibly it means "all files" generated for a particular Table or Scalar?

Slightly more general/flexible than that, but in essence, yes.



> 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"?

I believe that the files generated by mib2c/MfD include the option of compiling
a subagent for that particular table.  Wasn't that how you started originally?

That code will include a  file to provide the basic "subagent wrapper",
which is exactly the role that example-demon.c plays in the tutorial.


>   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?

If you've already guessed the answer - why bother asking me?
I've already told you that I know very little about the MfD framework.
Why not run this for yourself, and see what it actually looks like?



> 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.

But that specialized agent can also be used as an AgentX subagent,
*with* 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

I'm not making any recommendations at all.
I'm laying out the options as I understand them.
You can decide which way to go for yourself.


>                                                    If I did this then I would 
> be
> producing a subagent for each Table/Scaler defined in my MIB

The subagent as generated by mib2c/MfD would be specific to a
particular table, yes.   But the tweaks that I've suggested (whether
applied to 'example-demon.c' or a particular xxx_subgent.c file)
should allow you to combine everthing into a single subagent.

You've got to tweak one or other of these subagent driving
code files - I'm just offering you the choice of where you start from.




> 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)


> 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

No!
Each of these init routines should call the appropriate initialisation
for whatever objects (tables, scalars, etc) are contained in that
particular MIB module "chunk".
   "netsnmp_register_int_instance" is simply the appropriate call
for a single integer-valued scalar object - the form used in the tutorial.

What code should go into each of these routines will depend on what
objects are included in that particular chunk of the MIB.   In most
cases, I'd expect this to be generated for you automatically, so don't
bother fiddling with it.



>                                                       and that each of
> these "init" routines should be called from within the "example-demon.c"
> file?

Yes.



> 5)  I was planning on putting the "example-demon.c" module into the
> following location:
>
>   /agent/mibgroup/OC-STB-HOST-MIB/example-demon.c

You can put it wherever you like.
If you're compiling with 'example-demon.c' or the MfD equivalents,
then there is no need to have this code under 'agent/mibgroup' at all.
But if you wish to put it there - feel free.  It makes absolutely no
difference whatsoever.

It makes sense to have the 'example-demon.c' file in the same
general location as the rest of your MIB files.
But that's really all - /agent/mibgroup or /tmp/wombat - things
would work exactly the same either way.




> 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?

Please re-read my earlier post.


> ** Yes, I am new to the Linux environment ..... so I do not want to screw
> anything up.

Then you'll never learn anything!
You need to start grasping the nettle, and trying things for yourself.
You are *not* going to get a step-by-step, hand-holding explanation from
this mailing list.  Trying to get one will just risk alienating the people
that are here to help you.

The way you learn is by trying things for yourself - screwing things up,
and then working out what went wrong.



> 7) Just to confirm for myself .......

If you're confirming something for yourself, there's no need to discuss it
with the list first.  Try it, and see what happens.


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

Reply via email to