Article ID: 189131 - Last Review: July 11, 2005 - Revision: 2.3 How To Programmatically Trigger a SNMP Trap
This article was previously published under Q189131 SUMMARY
A monitoring device (extension agent) uses a Simple Network Management
Protocol (SNMP) trap to notify management station of some important event
that has occurred.
During the start up of the SNMP service (extendible agent), it invokes the SnmpExtensionInit entry point of all the registered extension agents. Within the SnmpExtensionInit entry point, the extension agent will create a Win32 event object and pass this event back to the extendible agent. When the extension agent wants to send a trap, it will signal this event. Then, the extendible agent is able to invoke the SnmpExtensionTrap entry point implemented by the extension agent that has just signaled the event and sends the SNMP trap to configured destinations via the extendible agent. This technique is demonstrated by the Testdll.dll SNMP extension agent sample located in \Mssdk\Samples\Netds\Snmp\Testdll of the Platform SDK. In some situations, the monitoring agent might be another process running in a different context other than the SNMP service. To allow this process to signal a trap event, the corresponding extension agent needs to create a named event with null DACL. Then, this monitoring process is able to trigger a SNMP trap by opening the named event and signaling it with Win32 OpenEvent and SetEvent APIs respectively. MORE INFORMATION
To allow another process trigger a trap event, follow these steps:
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
106387
(http://support.microsoft.com/kb/106387/EN-US/
)
How To Share Objects with a Service
128729
(http://support.microsoft.com/kb/128729/EN-US/
)
How To Add an SNMP Extension Agent to the NT Registry
MSDN Library: Microsoft Windows NT SNMP Agent Extensions white paper; SNMP
Agent Extensions
APPLIES TO
| Other Resources Other Support Sites
CommunityArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top