The following table describes the syntax of the two forms of the C call used to send events. Refer to Creating and sending an event for more information on how to use these calls.
int TWGSdEvt (char **type, char *text, short severity, char *dest);
int TWGEvent (TCHAR *family, TCHAR **qualifiers, TCHAR *template, char *locale, TCHAR **subst, short severity, struct _EventDetail **EvtDet, unsigned long groupid, unsigned long eventflags, char *dest, unsigned long controlflags);
Specify a NULL string to end the array.
Specify a NULL string to end the array.
Define name | Decimal value | Meaning |
SDEVT_EVENT_SEVERITY_FATAL | 0 | Fatal: The source of the event has caused a program failure and should be resolved before the program is restarted. |
SDEVT_EVENT_SEVERITY_CRITICAL | 1 | Critical: The source of the event might cause program failure and should be resolved immediately. |
SDEVT_EVENT_SEVERITY_MINOR | 2 | Minor: The source of the event should not cause immediate program failure, but should be resolved. |
SDEVT_EVENT_SEVERITY_WARNING | 3 | Warning: The event is not necessarily problematic, but might warrant investigation. |
SDEVT_EVENT_SEVERITY_HARMLESS | 4 | Harmless: The event is for information only; no potential problems should occur. |
SDEVT_EVENT_SEVERITY_UNKNOWN | 5 | Unknown: No severity level was assigned to the event. |
struct _EventDetail { TCHAR *ID; // ID TCHAR *keyword; // keyword TCHAR *reference; // a reference string ULONG ValueType; // a data type code from the table below void *value; // length of raw data depends on type }If there are no event details, EvtDet is NULL. Otherwise, the first NULL pointer ends the vector. Of the five members of the _EventDetail structure, three (keyword, value, and reference) are optional; each might be a NULL pointer. The other two fields are required. As type (TCHAR *) the ID, keyword, and reference strings can be type PCHAR on any platform. Alternatively, they can be type (WCHAR *) on Unicode platforms.
Define name | Decimal value | Meaning |
SDEVT_DATATYPE_CHAR8 | 1 | 8-bit signed |
SDEVT_DATATYPE_INT16 | 2 | 16-bit signed |
SDEVT_DATATYPE_INT32 | 3 | 32-bit signed |
SDEVT_DATATYPE_INT64 | 4 | 64-bit signed |
SDEVT_DATATYPE_BOOL | 5 | an 8-bit value which if zero means FALSE; otherwise TRUE |
SDEVT_DATATYPE_REAL32 | 6 | 32-bit floating point |
SDEVT_DATATYPE_REAL64 | 7 | 64-bit floating point |
SDEVT_DATATYPE_OCTET | 8 | an array of octets, preceded by a 32-bit length value |
SDEVT_DATATYPE_STRING16 | 9 | a string of Unicode characters |
SDEVT_DATATYPE_DATETIME | 10 | Date and time encoded as a 64-bit unsigned long, expressed as the number of milliseconds elapsed since 00:00:00 Coordinated Universal Time, January 1, 1970 |
SDEVT_DATATYPE_CHAR16 | 11 | a 16-bit unsigned, or Unicode character |
SDEVT_DATATYPE_INT8 | 12 | 8-bit signed |
Event Category | Description |
0 | Alert |
1 | Resolution |
Protocol | Ordinal | ID | ID example |
IPX | [none] | Internetwork address | A1:0005A296AC80 |
TCPIP | digit | Hostname or IP address | Director.raleigh.tivoli.com |
NETBIOS | digit | Computer name | User98 |
Notes:
Define name | Bit position | Meaning |
CONTROL_FLAG_ASYNCH | 0 | If 1, send the command asynchronously. |
Use TWGSDEVT.H as an included header to set the prototype for the entry points you want to call. You must define to the preprocessor the variable UNICODE when compiling if you are using type (WCHAR *) strings.
Define name | Decimal value | Meaning |
EXIT_SUCCESS | 0 | The operation was successful. |
SDEVT_CANT_OPEN_LOG | 2 | Could not open the log file. |
SDEVT_CANT_ALLOCATE_MEMORY | 3 | Could not allocate memory. |
SDEVT_NO_CONNECT | 5 | Could not establish a service node. |
SDEVT_NO_UNIQUE_ID | 6 | Could not determine system unique ID. |
SDEVT_NO_TYPE | 7 | No type provided. |
SDEVT_SEND_FAILED | 8 | Error response from SendCommand. |
SDEVT_NO_TEXT | 9 | No event text provided. |
SDEVT_BAD_SEVERITY | 10 | Incorrect severity code provided. |
SDEVT_NO_FAMILY | 11 | No family in type. |
SDEVT_MISSING_QUALIFIER | 12 | Missing qualifier in type. |
SDEVT_BAD_PROTOCOL | 13 | Unknown transport protocol. |
SDEVT_NO_ADDRESS | 16 | No target address provided. |
SDEVT_NO_QUALIFIERS | 17 | Type had no sublevels. |
SDEVT_SEND_TIMEOUT | 18 | Waited too long for response to SendCommand. |
SDEVT_ERROR_COMMUNICATING | 19 | Could not connect to destination. |
SDEVT_BAD_POINTER | 20 | Incorrect memory address was passed. |
SDEVT_CANT_GET_SERVERS | 21 | Failure requesting event servers. |
SDEVT_BAD_DETAIL_TYPE | 22 | An event detail has an incorrect data type. |
SDEVT_BAD_LANGUAGE | 23 | The locale has an incorrect language code. |
SDEVT_MISSING_DETAIL | 24 | An event detail was missing the required ID field. |