EMS Manual
Procedure Calls for Standard Events
EMS Manual—426909-005
11-43
Usage Threshold Programming Example
*/
, usage_threshold_cb /* usage threshold
control block */
, ZCOM_TKN_SUBJ_LINE /* subject token id */
, line_name /* subject value */
, LINE_NAME_LEN /* subject length */
, zcom_ssid /* subject ssid */
, buf_len /* return actual buffer
length */
, ZSPI_VAL_TRUE )) /* return actual buffer
length */
handle_error_usage_threshold(status);
/* Add additional tokens if needed */
if ( status = EMSADDTOKENS ( buffer
,/* ssid */
,MYAP_TKN_PARAM_CPU /*
token_code */
,token_value /* token
value */
,TOKEN_LENGTH ))
handle_error_add_token(status);
/* Get the size of the event buffer */
if (status = SSGETTKN ( buffer
,ZSPI_TKN_USEDLEN /* retrieve used
buff length */
,(char *)buf_len)) /* count */
handle_error_get_token(status);
/* Send the event to the collector */
if (!WRITEREAD (coll_num /* return value from OPEN
*/
,buffer /* event-message buffer */
,*buf_len /* from SSGETTKN above */
,0 )) /* read count */
handle_error_write_read();
} /* close if statement */
else
{
if (status != 0)
handle_error();
} /* close else statement */
return 0;
}