This topic describes how to extend IBM Director to support additional event sources.
The IBM Director Event Subscriber Client is an extendable service that manages events from external sources. The client manages events from external sources such as CIM, DMI, or the Windows NT Event Log, etc. by providing a framework by which available events can be described and sent selectively to the IBM Director server for additional processing. You can manage additional events by implementing an event source library.
When the Event Subscriber Client TWGESCLI.EXE is started, it searches for event source libraries. To be discovered by the Event Subscriber Client, an event source library must:
An event source library is a dynamic link library (DLL) that is loaded by the Event Subscriber Client at startup. To add a new event source library, do the following:
prototype | BOOL initialize( const RAS * const ras, const EventSubscriber * const eventSubscriber ) |
---|---|
parameters |
|
result |
|
prototype | LPCWSTR getRootQualifier( void ) |
---|---|
parameters | none |
result | The root qualifier. |
The event source library should allocate an event source descriptor (with details) for each event that it can generate. Append these event source descriptors to the list object passed to the method.
prototype | void eventSourceDescriptors( DListT < EventSourceDescriptor * > & eventSourceDescriptorList ) |
---|---|
parameters |
|
result | none |
LPWSTR qualifierList[ 2 ] = { L"sample", NULL }; EventDescriptor * eventDescriptor = new EventDescriptor( rootQualifier(), 1, (LPCWSTR *) qualifierList ); // get list of servers interested in this event DListT< Server * > serverList; eventSubscriber->getServerList( eventDescriptor, serverList ); if ( serverList.len() > 0 ) { for ( DWORD i = 0; i < serverList.len(); i++ ) { int rc = TWGEventW( (LPWSTR) rootQualifier(), // family qualifierList, // qualifiers L"sample event text" ), // message template "en", // locale NULL, // substitution variables SDEVT_EVENT_SEVERITY_UNKNOWN, // severity NULL, // event details serverList[ i ]->getGroupIdentifier(), // group identifier 0, // flags (LPSTR) serverList[ i ]->getAddress(), // destination address CONTROL_FLAG_ASYNCH ); // control flags if ( rc != 0 ) { ras->debug( "error sending event to server X\'%016I64X\' at address \"%s\"; rc = %d", serverList[ i ]->getIdentifier(), serverList[ i ]->getAddress(), rc ); } } /* for each server */ } /* indicate */
prototype | BOOL run( void ) |
---|---|
parameters | none |
result |
|
prototype | void updateIndication( void ) |
---|---|
parameters | none |
result | none |
prototype | BOOL finalize( void ) |
---|---|
parameters | none |
result |
|
The Event Subscriber Client, on the initialize() method call, passes a pointer to a RAS object to each event source library. An event source library should use this RAS object pointer to provide important debug and trace information. This information can be enabled directly via the RAS object pointer using the enable() method call or by creating the file twgescli.dbg in the bin directory. When enabled, debug and trace data are written to the file twgescli.log in the log directory.