\n");
/* host name column */
if(new_host==TRUE){
/* find extended information for this host */
temp_hostextinfo=find_hostextinfo(temp_status->host_name);
if(temp_hoststatus->status==HOST_DOWN)
host_status_bg_class="HOSTDOWN";
else if(temp_hoststatus->status==HOST_UNREACHABLE)
host_status_bg_class="HOSTUNREACHABLE";
else
host_status_bg_class=(odd)?"Even":"Odd";
printf("",host_status_bg_class);
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("| %s | \n",host_status_bg_class,EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),temp_status->host_name);
printf(" \n");
printf(" \n");
printf(" | \n");
printf("\n");
printf("\n");
printf("\n");
total_comments=number_of_host_comments(temp_host->name);
if(temp_hoststatus->problem_has_been_acknowledged==TRUE){
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,ACKNOWLEDGEMENT_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(total_comments>0)
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,COMMENT_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT,total_comments,(total_comments==1)?"":"s");
if(temp_hoststatus->notifications_enabled==FALSE){
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,NOTIFICATIONS_DISABLED_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_hoststatus->checks_enabled==FALSE){
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,DISABLED_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_hoststatus->is_flapping==TRUE){
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,FLAPPING_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_hoststatus->scheduled_downtime_depth>0){
printf(" | ",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),url_images_path,SCHEDULED_DOWNTIME_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_hostextinfo!=NULL){
if(temp_hostextinfo->icon_image!=NULL){
printf("");
if(temp_hostextinfo->notes_url!=NULL){
printf("");
}
printf(" ",url_logo_images_path,temp_hostextinfo->icon_image,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT,(temp_hostextinfo->icon_image_alt==NULL)?"":temp_hostextinfo->icon_image_alt);
if(temp_hostextinfo->notes_url!=NULL)
printf("");
printf(" | \n");
}
}
printf(" | \n");
printf(" \n");
printf(" | \n");
printf(" \n");
printf(" \n");
}
else
printf(" | ");
printf(" | \n");
/* service name column */
printf("",status_bg_class);
printf("");
printf("");
printf("");
printf("\n");
printf("\n");
printf("| %s | ",url_encode(temp_status->description),temp_status->description);
printf(" \n");
printf(" \n");
printf(" | \n");
printf("\n",status_bg_class);
printf("\n");
printf("\n");
total_comments=number_of_service_comments(temp_service->host_name,temp_service->description);
if(total_comments>0){
printf(" | ",url_encode(temp_status->description),url_images_path,COMMENT_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT,total_comments,(total_comments==1)?"":"s");
}
if(temp_status->problem_has_been_acknowledged==TRUE){
printf(" | ",url_encode(temp_status->description),url_images_path,ACKNOWLEDGEMENT_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_status->checks_enabled==FALSE){
printf(" | ",url_encode(temp_status->description),url_images_path,DISABLED_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_status->notifications_enabled==FALSE){
printf(" | ",url_encode(temp_status->description),url_images_path,NOTIFICATIONS_DISABLED_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_status->is_flapping==TRUE){
printf(" | ",url_encode(temp_status->description),url_images_path,FLAPPING_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
if(temp_status->scheduled_downtime_depth>0){
printf(" | ",url_encode(temp_status->description),url_images_path,SCHEDULED_DOWNTIME_ICON,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT);
}
temp_serviceextinfo=find_serviceextinfo(temp_service->host_name,temp_service->description);
if(temp_serviceextinfo!=NULL){
if(temp_serviceextinfo->icon_image!=NULL){
printf("");
if(temp_serviceextinfo->notes_url!=NULL){
printf("");
}
printf(" ",url_logo_images_path,temp_serviceextinfo->icon_image,STATUS_ICON_WIDTH,STATUS_ICON_HEIGHT,(temp_serviceextinfo->icon_image_alt==NULL)?"":temp_serviceextinfo->icon_image_alt);
if(temp_serviceextinfo->notes_url!=NULL)
printf("");
printf(" | \n");
}
}
printf(" \n");
printf(" \n");
printf(" | \n");
printf(" ");
printf(" ");
printf(" | \n");
/* state duration calculation... */
duration_error=FALSE;
t=0;
if(temp_status->last_state_change==(time_t)0){
if(program_start>current_time)
duration_error=TRUE;
else
t=current_time-program_start;
}
else{
if(temp_status->last_state_change>current_time)
duration_error=TRUE;
else
t=current_time-temp_status->last_state_change;
}
get_time_breakdown((unsigned long)t,&days,&hours,&minutes,&seconds);
if(duration_error==TRUE)
snprintf(state_duration,sizeof(state_duration)-1,"???");
else
snprintf(state_duration,sizeof(state_duration)-1,"%2dd %2dh %2dm %2ds%s",days,hours,minutes,seconds,(temp_status->last_state_change==(time_t)0)?"+":"");
state_duration[sizeof(state_duration)-1]='\x0';
/* the rest of the columns... */
printf("%s | \n",status_class,status);
printf("%s | \n",status_bg_class,date_time);
printf("%s | \n",status_bg_class,state_duration);
printf("%d/%d | \n",status_bg_class,temp_status->current_attempt,temp_status->max_attempts);
printf("%s | \n",status_bg_class,temp_status->information);
printf("
\n");
last_host=temp_status->host_name;
}
}
printf("