On Tue, 2005-06-28 at 01:39, Steve S. Law wrote:
> I have a sub-agent that NEEDs to read some
> configurable parameters specific to my application. 
> 
> (1) Where do I put those paramters?
> In my sub-agent main program, I have
> 
> init_subagent("my-agent");
> init_snmp("my-agent);

Then they should go in a file 'my-agent.conf' probably in
the same directory as the usual 'snmpd.conf' files.


> I look at auto-generated "/var/net/my-agent.conf"
> file, but it says do not edit this file. This is the
> only file called my-agent.conf that I can find on my
> machine.

No - it's up to you to create the config files yourself.

>  So, I am not sure where/which file I should
> put my parameters in.

Try
        /usr/local/etc/snmp/my-agent.conf
or
        /usr/local/share/snmp/my-agent.conf

If that doesn't work, run the agent using -Dread_config
to see where exactly it's looking.


> (2) What API calls should my sub-agent make in order
> to get those values? Any examples?

Have a look through the 'agent/mibgroup' tree, for mention
of "snmpd_register_config_handler".   This includes the
name of the routine used to parse that particular config token.

How you then get that information to the code that needs to
use it is up to you - the existing MIB code should illustrate
various possible approaches.

Dave



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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

Reply via email to