On 7 August 2011 21:24, Bob ONeil <[email protected]> wrote:
>   In my implementation, the destination IP for the traps will be given
> to my application over the SNMP interface as a scalar value.

> Therefore, the  destination IP is somewhat dynamic and can’t be know a
> priori to that it may be written to the config file.  I do not want to
> runtime write the destination IP to
> the configuration file, and then restart the agent using system calls if at
> all possible.

If you are handling this from within the master SNMP agent,
then you could invoke the config-handling code using a
suitably constructed string - i.e the equivalent of what you
would otherwise have read in from the config file.

Probably something like
    sprintf( mybuf, "trapsink %s",  newdest )
    snmp_config_when( mybuf, NORMAL_CONFIG );

(untested!)


Otherwise if you're working from a subagent or some other application,
then you''ll probably be looking at manipulating the snmpNotifyTable,
snmpTargetAddrTable and snmpTargetParamsTable directly,
using SET commands.
   Try walking these tables to see what entries get installed by
the "trapsink" (and similar) directives under the normal agent.
Then use "snmpset" to reproduce these manually.

Once you've identified the appropriate SET varbinds to use,
then you can hardcode these into your subagent/application.

Dave

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to