Hi Dave,
Thanks for the information.
The below details gives more clarity on my project and the issues.
Trap generation:
send_v2trap()
The process generating the alarms------------>SNMP trap
generator--------------------------------->net-snmp main agent
SNMP master agent configuration:
[GUI based configuration tool] ---> XML files --> Process reads the
configuration info stored in XML file --->net-snmp master agent
(Config manager)
1. I was able to use send_v2trap() to generate the SNMPv2 traps. In order to
test this, I configured the trap receiver address in the snmpd.conf file.
But I need to know how we can configure the trap receiver address and the
community string from a standalone (separate) application or from a AgentX
subagent?
Please refer the figure above. I am using a GUI based tool to configure the
system. Text boxes will be provided to the user for configuring the trap
receiver address and the community string. When the user configures it, they
will be stored in the XML files and the change is informed to another
process using XML RPC. This process(lets say "config manager") reads the XML
files and retreives the configuration information. I need a way for this
config manager to use this configuration details to configure the net-snmp
master agent. Please let me know how this can be done.
2. How trap receiver address(and community string) can be configured from a
AgentX subagent?
3. How trap receiver address(and community string) can be configured from a
Dynamically Loadable Object (written by referring to
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Dynamically_Loadable_Object
)?
4. I understand (from your reply below) that we can configure the trap
receiver address from the main SNMP agent by using netsnmp_config("trapsink
10.20.30.40"). So does that mean the config. manager(mentioned in 1 above)
source code should be compiled with the net-snmp source code (by running
configure with --with-mib-modules="path/config_manager")?
I cannot use the net-snmp source code in my project. I am using
net-snmp-devel package.
Appreciate your feedback on this.
Thanks
Goutham B G
On Thu, Nov 12, 2009 at 9:54 PM, Dave Shield <[email protected]>wrote:
> 2009/11/12 Goutham BG <[email protected]>:
> > I am using net-snmp to send alarms generated in the system
> > as SNMPv2 trap notifications.
>
> Is this a standalone application, a separate subagent,
> or a module within the main SNMP agent?
>
> How are you sending the traps?
>
> > As part of this I need a way to configure the trap receiver
> > address and the community string from a C/C++ program
> > (or a subagent).
>
> If this is part of the main SNMP agent, then the easiest way
> would probably be to call
> netsnmp_config("trapsink 10.20.30.40");
>
> That sets up the trap destination, in exactly the same way
> as the equivalent line in snmpd.conf would do.
>
>
> If this is part of a standalone application, then it's up to you
> to initialise the netsnmp_session structure used for sending
> the trap. So you can configure the appropriate destination
> yourself.
>
>
> If this is part of an AgentX subagent, then it's not really possible.
> At least, not if using the 'sent_trap()' style of call. The subagent
> simply passes the notification off to the master agent, and it's
> up to the master agent where these are sent.
> The only sensible approach here would be to send the traps
> directly to the required destination. In which case, this is
> effectively a standalone application. See the previous case.
>
> Dave
>
------------------------------------------------------------------------------
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