return;
}
/* handle data from Nagios daemon */
int helloworld_handle_data(int event_type, void *data){
nebstruct_aggregated_status_data *agsdata=NULL;
char temp_buffer[1024];
/* what type of event/data do we have? */
switch(event_type){
case NEBCALLBACK_AGGREGATED_STATUS_DATA:
/* an aggregated status data dump just started or ended... */
if((agsdata=(nebstruct_aggregated_status_data *)data)){
/* log a message to the Nagios log file */
snprintf(temp_buffer,sizeof(temp_buffer)-1,"helloworld: An aggregated status update just %s.",(agsdata->type==NEBTYPE_AGGREGATEDSTATUS_STARTDUMP)?"started":"finished");
temp_buffer[sizeof(temp_buffer)-1]='\x0';
write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE);
}
break;
default:
break;
}
return 0;
}
=2=
THE END |