> I am attempting to extend net-snmp as an application monitoring tool, 
> and am running into a problem:
> 
> Is there a simple way to get net-snmp to send dynamically configured 
> periodic traps?  In other words, for any registered variable in the 
> agent, I want to be able to have the variable sent to a trap sink at a

> configurable time interval, and I want to trigger/de-trigger which 
> variables get sent while the agent is running.  I am only interested
in 
> doing this for explicitly specified variables (e.g. via SNMP_MSG_GET, 
> not *_GETNEXT).
> 

What I've done to make this happen is to use the snmp_alarm_register()
mechanism to get called back when it is time to send a trap.
Here's a code fragment that's invoked whenever the update interval is
set/changed:
  /* Unregister before updating */
  if ( pApp->hHeartBeatAlarm > 0 ) 
        snmp_alarm_unregister( pApp->hHeartBeatAlarm );
  pApp->hHeartBeatAlarm = snmp_alarm_register( iVal, SA_REPEAT,
SendHeartBeatTrap, pApp );

where SendHeartBeatTrap() is my function that builds the trap vars and
then calls send_enterprise_trap_vars() to send the trap.






-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to