This section provides a brief description of the approach for enabling an application to send events to the Tivoli/Application Manager console using the Tivoli Event Integration Facility (EIF).
Note: | The Tivoli Manager of Applications 1.0 product does not support application monitoring using EIF events. Monitoring is available only through synchronous monitors. Monitoring of EIF events will be supported in the Tivoli Manager of Applications 2.0. |
As T/MA imports new applications, it will generate and install an EIF event group for each application. The event group will be set up with one filter set to the Application Name. The Application Name can be specified by the tvInitTamEvents call or can be overridden by an application= entry in the teceif configuration file located on each target machine that is sending events.
These Event Groups will be used to filter events that are delivered to the T/MA console and the T/MA event viewer. From the detailed event view, further filtering by component, severity, origin, deployment group, etc., can be performed. Sends an application event to the TEC. All standard event slots except for class, message and severity are populated by the event DLL (or by the TEC server).
The library will populate event slots as follows:
The TECEIF.DLL will look for a TECEIF.CFG configuration file in the same directory as the TECEIF.DLL.
The following entries will be read when the TECEIF.DLL is started:
The default teceif.cfg file will contain the following lines:
Server=unknown TestMode=YES
// TECEIF.H // interface to the TECEIF .DLL to send events to a TEC server #ifndef _TECEIF_H #define _TECEIF_H // only define _TECEIF_DLL in the TECEIF DLL #ifdef _TECEIF_DLL #define MYLIBAPI __declspec(dllexport) #define MYREFAPI #else #define MYLIBAPI __declspec(dllimport) #define MYREFAPI "C" #endif // severity defines can ether define or text string #define EIF_FATAL "Fatal" #define EIF_CRITICAL "Critical" #define EIF_SEVERE "Severe" #define EIF_WARNING "Warning" #define EIF_HARMLESS "Harmless" #define EIF_NORAML "Normal" // a structure for passing name value pairs into send event calls #define MAX_EIF_NAME 32 #define MAX_EIF_VALUE 256 // structure for name value pairs to be inserted into event typedef struct tagNameValue { char szName[MAX_EIF_NAME]; // name for slot value BOOL bInteger; // use integer or string field int nValue; // integer field 32 bits char szValue[MAX_EIF_VALUE]; // string field } NAMEVALUE, *PNAMEVALUE; // generic EIF initialization long WINAPI tvInitEvents( char *szPathName, // full path to config file char *pszSource, // application name from gdf file char *pszSubSource); // component name from cdf file // send event call long WINAPI tvSendEvent( char *pszClass, // class type from BAROC file char *pszSeverity, // severity from list above int nNumValues, // num of name/value pairs PNAMEVALUE pNameValues, // name value pairs to include in event char *pszMessage, // message which can include printf ...); // formatting NOTE: arg list must match // formatting in szMessage as the compiler // will not check this! // shut down EIF long WINAPI tvTecClose(); // TAM specific calls long WINAPI tvInitTamEvents( char *pszPathName, // full path to config file char *pszApplicationName, // application name from gdf file char *pszComponentName); // component name from CDF file // event for program startup long WINAPI tvSendStartupEvent( char *pszMessage); // appropriate message // event for program in idle state long WINAPI tvSendIdleEvent( char *pszMessage); // appropriate message // event for program shutdown long WINAPI tvSendShutdownEvent( char *pszMessage); // appropriate message // event for internal program error long WINAPI tvSendApplicationError( int nErrorNum, // internal error number char *pszMessage); // appropriate message // event for SQL login or transaction error long WINAPI tvSendSQLError( int nSQLCode, // standard SQL error code char *pszServer, // name of database server char *pszDataBase, // name of databse char *pszTable, // table in database char *pszMessage); // message #endif
The following event slots are defined for application events:
source = Application Name, as it appears in the "Application Name" attribute of the GDF for the application. This field can be overridden by an application = entry in the EIF configuration file.
sub_source = Component Name, as it appears in the "Component Name" attribute of the CDF for the component, This field can be overridden by a component= entry in the EIF configuration file.
origin = IP address
sub_origin = The operating system and version.
hostname = local hostname, as obtained by the gethostname()
function or equivalent
Application developers can either use the standard event classes or derive their own classes from the Application base event class.
TEC_CLASS: Application_synchronous_monitor ISA Sentry2_0_Base END
TEC_CLASS: Application_process_failure ISA Sentry2_0_Base END
TEC_CLASS: Application_process_restart ISA Sentry2_0_Base END
TEC_CLASS: Application_performance_alert ISA Sentry2_0_Base END
TEC_CLASS: Application_out_of_resources ISA Sentry2_0_Base END
TEC_CLASS: Application_low_on_resources ISA Sentry2_0_Base END
TEC_CLASS: Application_message_logged ISA Sentry2_0_Base END
TEC_CLASS: Application_transaction_failure ISA Sentry2_0_Base END
TEC_CLASS: Application_communication_failure ISA Sentry2_0_Base END
TEC_CLASS: Application_security_alert ISA Sentry2_0_Base END
TEC_CLASS: Application_audit_alert ISA Sentry2_0_Base END
TEC_CLASS: Application_Event ISA EVENT DEFINES { source: default = "Application Name"; sub_source: default = "Component Name"; sub_origin: default = "TME Managed Node Name"; deployment_map: STRING ; }; END
TEC_CLASS: Application_notice ISA Application_Event DEFINES { severity: default = HARMLESS; }; END
TEC_CLASS: Application_warning ISA Application_Event DEFINES { severity: default = WARNING; }; END
TEC_CLASS: Application_error ISA Application_Event DEFINES { severity: default = CRITICAL; };END
TEC_CLASS: Application_startup ISA Application_notice; END
TEC_CLASS: Application_idle ISA Application_notice; END
TEC_CLASS: Application_shutdown ISA Application_notice; END
TEC_CLASS: Application_System_error ISA Application_error DEFINES { error_number: INTEGER; }; END
TEC_CLASS: Application_SQL_error ISA Application_error DEFINES { sqlcode: INTEGER; database: STRING; table: STRING; sqlca: STRING; }; END