On 23 November 2011 11:00, prashant n <[email protected]> wrote:
> 1) If i want to handle other objects with types such as table, float,
> string etc.. then what changes i need to do in source file example-demon.c ?
>From the FAQ entry
Which mib2c configuration file should I use?
For implementing a group of scalar objects, then the choice is
simple - use 'mib2c.scalar.conf'.
This will generate a template code file, that you can include in a similar
way to the example you've already been working with.
It's probably also worth having a look at the file
'agent/mibgroup/example/watched.c'
which shows another approach to handling a single string object.
Handling floats or OID scalars is similar.
As far as tables are concerned, there's more about the possible choices
for this in the same FAQ entry.
Personally, I tend to work with the 'table_data' template style.
(often in conjunction with the 'cache' helper - try
mib2c -S cache=1 -c mib2c.table_data MY-MIB::myTable )
> 2) Whether the following code i need to add in example-demon.c for
> individual MIB objects such as table, string etc..?
>
> /* initialize mib code here */
> /* mib code: init_nstAgentSubagentObject from nstAgentSubagentObject.C */
> init_nstAgentSubagentObject();
If you've got multiple code files (each with their own init_xxx() routine)
then yes - you would need to list each of these init_xxx routines
as part of starting up the subagent.
> 3) Whether any changes required in Makefile ?
I'm not particularly familiar with the details of this tutorial,
but at a quick glance - you'd probably have to repeat the
nstAgentPluginObject.so target for each of your other MIB module files,
and add these new objects to the OBJS2 definition.
Dave
------------------------------------------------------------------------------
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. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders