How To Programmatically Trigger a SNMP Trap (189131)
The information in this article applies to:
- Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
- the operating system: Microsoft Windows NT 3.51
- the operating system: Microsoft Windows NT 4.0
- the operating system: Microsoft Windows 2000
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.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
106387 How To Share Objects with a Service
128729 How To Add an SNMP Extension Agent to the NT Registry
MSDN Library: Microsoft Windows NT SNMP Agent Extensions white paper; SNMP
Agent Extensions
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbAPI kbhowto kbnetwork kbSNMP KB189131 |
---|
|