EMS Manual
Example of Reporting Events
EMS Manual—426909-005
B-7
The C Source File
/*
 * The EMS Collector name and file number when OPEN'ed
 */
 char coll_name[] = "$ACOL"; /* Name of the collector process */
 short coll_filenum;
 char in_msg[132];
 short in_msg_len = sizeof(in_msg);
/*
 * SS or EMS PUT of values can't be literals
 */
 short true_val = ZSPI_VAL_TRUE;
 short false_val = ZSPI_VAL_FALSE;
/*
 * PROCESS_LAUNCH_ variables
 */
 process_launch_parms_def paramList = P_L_DEFAULT_PARMS_;
 zsys_ddl_smsg_proccreate_def outputList;
 short error, errorDetail, outputListLen;
#pragma PAGE "too_long"
/*
 * This procedure accepts the values for the time-too-long event, places
 * the values with the appropriate tokens in the event buffer using the
 * EMS procedure, and sends the event message to the Alternate Collector,
 * $ACOL, by using the file system FILE_OPEN_, WRITEREADX, and 
 * FILE_CLOSE_ procedures.
 *
 * If the event message can't be generated, or an error sending the event
 * message to $ACOL occurs, DEBUG is called.
 */
void too_long(char *file_name, long long io_time,
 char *io_msg, short io_len, long num_ios)
{
 short spi_error = 0 ; /* to save last SPI error for debug */
 short emphasis = ZSPI_VAL_FALSE; /* true if io_time is over a minute */
 short size; /* length of buffer */
 xour_ddl_too_long_stats_def *too_long_stats;
 short i;
 int fs_error;
 too_long_stats = (xour_ddl_too_long_stats_def *)
 malloc (sizeof(xour_ddl_too_long_stats_def));
 event_buf = (xour_ddl_evt_buffer_def *)
 malloc (sizeof(xour_ddl_evt_buffer_def));
 strncpy(our_ssid.z_owner.u_z_c.z_c, XOUR_VAL_OURCO, 8);
 our_ssid.z_number = XOUR_SSN_XOUR; /* value is 1 */
 our_ssid.z_version = XOUR_VAL_VERSION; /* value is 3 */
 strncpy(ems_ssid.z_owner.u_z_c.z_c, ZSPI_VAL_TANDEM, 8);
 ems_ssid.z_number = ZSPI_SSN_ZEMS;
 ems_ssid.z_version = ZEMS_VAL_VERSION;
 for (i = 0; i < XOUR_MAP_TOO_LONG; i++)
 map_too_long_stats[i] = xour_map_too_long_stats[i];
 /* Begin to executable code of too_long proc */
 evt_calls = evt_calls + 1;
 /* Initialize buffer */










