This is a discussion on RE: mechanism for sending periodic traps? within the SNMP Coders forums, part of the Networking and Network Related category; > I am attempting to extend net-snmp as an application monitoring tool,=20 > and am running into a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> I am attempting to extend net-snmp as an application monitoring tool,=20 > and am running into a problem: >=20 > Is there a simple way to get net-snmp to send dynamically configured=20 > periodic traps? In other words, for any registered variable in the=20 > 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=20 > variables get sent while the agent is running. I am only interested in=20 > doing this for explicitly specified variables (e.g. via SNMP_MSG_GET,=20 > not *_GETNEXT). >=20 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 )=20 snmp_alarm_unregister( pApp->hHeartBeatAlarm ); pApp->hHeartBeatAlarm =3D 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_id=6595&alloc_id=14396&op=click _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|