On 27/02/2008, Ajit J Clarence wrote:
> a) Is there any way, we could associate a C program as a trap handler


Yes.
The "traphandle" directive simply invokes a program to process the trap.
It doesn't care whether that program is written in perl, C, Java, Pascal,
Basic, Ada, Lisp, Modula-2, Forth, Logo, or something that you've
invented yourself.
As long as it accepts the trap information in the format specified,
you can code it however you like.


> b) Is it possible to associate trap handlers using some piece of code
> (in snmptrapd daemon) rather than changing the snmptrapd.conf file


Yes - this is possible.
See 'apps/snmptrapd_handlers.c' for examples of the internal trap handler
interface.

Unfortunately there isn't any support for cleanly linking in separate
C code files (equivalent to the --with-mib-modules mechanism for the
agent). So you'll have to add your handler to the snmptrapd code
yourself, and recompile.
But it's certainly possible.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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/...net-snmp-users