Re: notification filtering

Mark Ellison <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Ellison Software Consulting, Inc.
Message-ID <[email protected]>
Hi Anna,

Thanks for the good pointer.  I guess this area is still under 
construction.  I can see in the source code how the execution path uses 
the snmp_call_calbacks() method to invoke the send_notifications() 
method in snmpNotifyTable.c. which in turn calls the 
get_target_sessions() method.  The second parameter of the 
get_target_sessions() method provides the method address for the 
filterfunc routine.  In the 5.2.1.2 code I have, this second parameter 
is null.  I used gdb to step into the get_target_sessions, and found the 
parm values were always (interal0, NULL, NULL). 

Thanks for helping me understand whats going on here!

Regards,

Mark

Anna Edwards wrote:

>Hi Mark,
>
>I'm by no means an expert in this field, but I've been digging around in that same area for a few weeks now, and here's my conclusions:
>
>The net-snmp agent has the ability to populate the SNMP-NOTIFICATION-MIB and SNMP-TARGET-MIB tables, if the agent is configured to include the modules. There are two calls to callback function at the end of the netsnmp_send_traps (in agent_trap.c) which can do the sending of notifications to traps other than those configured as static trapsinks. The send_notifications function in snmpNotifyTable.c is registered to do this, and looks at the entries in the snmpNotifyTable and snmpTargetAddrTable to determine what targets to send to. There is support to pass a pointer to a function (of type TargetFilterFunction -- see target.h) to get_target_sessions to do the actual filtering according to the notification filter tables, however no such function exists as of yet. So, the all framework is there to do the filtering; you just need to write the actual filtering function that refers to the entries in the filter tables with the matching parameter and OIDs (which is surely easier said than done...)
>
>Hope this helps, good luck!
>________________
>Anna Edwards
>Software Engineer
>www.sandvine.com
>
>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]]On Behalf Of Mark
>Ellison
>Sent: Friday, September 30, 2005 4:02 PM
>To: [email protected]
>Subject: notification filtering
>
>
>Hi,
>
>I am looking at the net-snmp-5.2.1.2 distribution to figure out if I can 
>populate the SNMP notification filtering tables and then use these 
>tables to filter outgoing notifications based upon the value of the 
>snmpTrapOID.0 varbind in the outgoing pdu.
>
>I see calls to the snmpd_register_config_handler() routine for the 
>snmpNotify*Table configuration token handlers, but I do not see any code 
>on the way out (diving down send_v2trap()) that might make the 
>appropriate comparisons for filtering.  It appears that each registered 
>trap2sink receives all notifications or none.
>
>If someone could point me in the right direction with respect to 
>filtering of notifications originated at the agent, I'd appreciate it.
>
>Regards,
>
>Mark
>
>  
>





-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.