>>>>> On Fri, 13 Nov 2009 20:04:08 +0530, Goutham BG <[email protected]> said:

GB> But I need to know how we can configure the trap receiver address and the
GB> community string from a standalone (separate) application or from a AgentX
GB> subagent?

The Net-SNMP master agent, which follows the IETF specified RFCs when it
comes to sending notifications out, sends all notifications (traps) to
every address it has been configured to send traps to.  It *always*
works like this:

                 +------------+
                 | Receiver 1 |
                 +------------+
                   ^
                   |
                   |
  +--------+     +------------+     +------------+
  |  Trap  |     |   Master   |     |            |
  | Source |     |   Agent    |     | Receiver 2 |
  |   1    | --> |            | --> |            |
  +--------+     +------------+     +------------+
                   ^
                   |
                   |
  +--------+     +------------+
  |  Trap  |     |   AgentX   |
  | Source |     |   Client   |
  |   2    | --> |    Code    |
  +--------+     +------------+

Where trap source 2 is an agentx source of notifications, for example,
and trap source 1 is an internal one.  The point, though, is that
everything goes through the main sending process.  The snmpd.conf and
the SNMP-TARGET-MIB/SNMP-NOTIFICATION-MIB control which receivers
actually have the notifications sent to them.

We do support (in recent releases) notification filtering so you can
actually specify that receiver 2 shouldn't get certain traps, for
example.

But you're not supposed to use APIs that say "send this notification to
host X".  The APIs are designed with the above in mind so the low-level
code can just say "Please send this" and it'll send it to wherever it's
been configured to send it to.  You *can* hack around this, but we don't
encourage it.

GB> I need a way for this config manager to use this configuration
GB> details to configure the net-snmp master agent. Please let me know
GB> how this can be done.

You can have the XML be translated into appropriate snmpd.conf settings
and put on the device, or you can remotely configure it using SNMP SETs
to the SNMP-TARGET-MIB and SNMP-NOTIFICATION-MIB MIBs.

GB> 2. How trap receiver address(and community string) can be configured from a
GB> AgentX subagent?

It can't; more importantly: it shouldn't be.  Only the master agent
should have that configuration.  The AgentX protocol doesn't allow for
the subagent to specify where notifications are supposed to be sent.

GB> 3. How trap receiver address(and community string) can be configured from a
GB> Dynamically Loadable Object (written by referring to
GB> 
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Dynamically_Loadable_Object
GB> )?

See the config file processing for the snmpd.conf configuration tokens
if you want to duplicate configuration possibilities from another source
without translating first.

GB> 4. I understand (from your reply below) that we can configure the trap
GB> receiver address from the main SNMP agent by using netsnmp_config("trapsink
GB> 10.20.30.40"). So does that mean the config. manager(mentioned in 1 above)
GB> source code should be compiled with the net-snmp source code (by running
GB> configure with --with-mib-modules="path/config_manager")?
GB> I cannot use the net-snmp source code in my project. I am using
GB> net-snmp-devel package.

You should be able to call netsnmp_config() from within a dynamicly
loaded module too.
-- 
Wes Hardaker
Please mail all replies to [email protected]

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to