diff -aur nagios-3.2.3-CVS-20101105/cgi/cgiutils.c nagios-3.2.3+Fixes/cgi/cgiutils.c
--- nagios-3.2.3-CVS-20101105/cgi/cgiutils.c 2010-10-23 11:57:45.000000000 +0200
+++ nagios-3.2.3+Fixes/cgi/cgiutils.c 2010-11-05 13:18:34.000000000 +0100
@@ -920,7 +920,7 @@
}
/* spaces are pluses */
- else if((char)input[x]<=(char)' '){
+ else if((char)input[x]==(char)' '){
str[y]='+';
y++;
}
diff -aur nagios-3.2.3-CVS-20101105/cgi/config.c nagios-3.2.3+Fixes/cgi/config.c
--- nagios-3.2.3-CVS-20101105/cgi/config.c 2010-10-28 14:31:40.000000000 +0200
+++ nagios-3.2.3+Fixes/cgi/config.c 2010-11-05 15:00:31.000000000 +0100
@@ -2377,10 +2377,7 @@
printf("
dangling whitespace: \n",bg_class,bg_class);
printf("$ARG%u$=",bg_class,i);
for (c=command_args[i],j=0;c&&isspace(*c);c++,j++)
- /* TODO: As long as the hyperlinks change all whitespace into actual spaces,
- we'll output "[WS]" (whitespace) instead of "[SP]"(ace). */
- /* if ((*c)==' ') printf("[SP]"); */
- if ((*c)==' ') printf("[WS]");
+ if ((*c)==' ') printf("[SP]");
else if ((*c)=='\f') printf("[FF]");
else if ((*c)=='\n') printf("[LF]");
else if ((*c)=='\r') printf("[CR]");
@@ -2391,10 +2388,7 @@
for (;c&&((*c)!='\0')&&(j");
for (;c&&((*c)!='\0');c++)
- /* TODO: As long as the hyperlinks change all whitespace into actual spaces,
- we'll output "[WS]" (whitespace) instead of "[SP]"(ace). */
- /* if ((*c)==' ') printf("[SP]"); */
- if ((*c)==' ') printf("[WS]");
+ if ((*c)==' ') printf("[SP]");
else if ((*c)=='\f') printf("[FF]");
else if ((*c)=='\n') printf("[LF]");
else if ((*c)=='\r') printf("[CR]");
@@ -2456,7 +2450,7 @@
printf("Contact Groups\n",(display_type==DISPLAY_CONTACTGROUPS)?"SELECTED":"");
printf(" Timeperiods\n",(display_type==DISPLAY_TIMEPERIODS)?"SELECTED":"");
printf(" Commands\n",(display_type==DISPLAY_COMMANDS)?"SELECTED":"");
- printf(" Command Expansion\n",(display_type==DISPLAY_COMMAND_EXPANSION)?"SELECTED":"");
+ printf(" Command Expansion\n",(display_type==DISPLAY_COMMAND_EXPANSION)?"SELECTED":"");
printf("\n");
printf(" \n");
diff -aur nagios-3.2.3-CVS-20101105/cgi/extinfo.c nagios-3.2.3+Fixes/cgi/extinfo.c
--- nagios-3.2.3-CVS-20101105/cgi/extinfo.c 2010-11-05 00:42:18.000000000 +0100
+++ nagios-3.2.3+Fixes/cgi/extinfo.c 2010-11-05 14:32:29.000000000 +0100
@@ -1092,7 +1092,10 @@
get_time_string(&temp_hoststatus->last_check,date_time,(int)sizeof(date_time),SHORT_DATE_TIME);
printf("\n");
printf("\n");
- printf("Active Checks: %s
\n",(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED",(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED");
+ if ((temp_host->host_check_command)&&(*temp_host->host_check_command!='\0'))
+ printf("Active Checks: %s
\n",CONFIG_CGI,url_encode(temp_host->host_check_command),(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED",(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED");
+ else printf("Active Checks: %s
\n",(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED",(temp_hoststatus->checks_enabled==TRUE)?"ENABLED":"DISABLED");
printf("Passive Checks: %s
\n",(temp_hoststatus->accept_passive_host_checks==TRUE)?"ENABLED":"DISABLED",(temp_hoststatus->accept_passive_host_checks)?"ENABLED":"DISABLED");
@@ -1158,7 +1163,9 @@
printf("Notifications: %s
\n",(temp_hoststatus->notifications_enabled)?"ENABLED":"DISABLED",(temp_hoststatus->notifications_enabled)?"ENABLED":"DISABLED");
- printf("Event Handler: %s
\n",(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED");
+ if ((temp_host->event_handler)&&(*temp_host->event_handler!='\0'))
+ printf("Event Handler: %s
\n",CONFIG_CGI,url_encode(temp_host->event_handler),(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED");
+ else printf("Event Handler: %s
\n",(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_hoststatus->event_handler_enabled)?"ENABLED":"DISABLED");
printf("Flap Detection: %s
\n",(temp_hoststatus->flap_detection_enabled==TRUE)?"ENABLED":"DISABLED",(temp_hoststatus->flap_detection_enabled==TRUE)?"ENABLED":"DISABLED");
@@ -1405,7 +1412,10 @@
get_time_string(&temp_svcstatus->last_check,date_time,(int)sizeof(date_time),SHORT_DATE_TIME);
printf("Last Check Time: %s \n",date_time);
- printf("Check Type: %s \n",(temp_svcstatus->check_type==SERVICE_CHECK_ACTIVE)?"ACTIVE":"PASSIVE");
+ if (temp_svcstatus->check_type==SERVICE_CHECK_ACTIVE)
+ printf("Check Type: ACTIVE \n",
+ CONFIG_CGI,url_encode(temp_service->service_check_command));
+ else printf("Check Type: PASSIVE \n");
printf("Check Latency / Duration: ");
if(temp_svcstatus->check_type==SERVICE_CHECK_ACTIVE)
@@ -1465,7 +1475,9 @@
printf(" \n");
printf("\n");
- printf("Active Checks: %s
\n",(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED");
+ if ((temp_service->service_check_command)&&(*temp_service->service_check_command!='\0'))
+ printf("Active Checks: %s
\n",CONFIG_CGI,url_encode(temp_service->service_check_command),(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED");
+ else printf("Active Checks: %s
\n",(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->checks_enabled)?"ENABLED":"DISABLED");
printf("Passive Checks: %s
\n",(temp_svcstatus->accept_passive_service_checks==TRUE)?"ENABLED":"DISABLED",(temp_svcstatus->accept_passive_service_checks)?"ENABLED":"DISABLED");
@@ -1473,7 +1485,9 @@
printf("Notifications: %s
\n",(temp_svcstatus->notifications_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->notifications_enabled)?"ENABLED":"DISABLED");
- printf("Event Handler: %s
\n",(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED");
+ if ((temp_service->event_handler)&&(*temp_service->event_handler!='\0'))
+ printf("Event Handler: %s
\n",CONFIG_CGI,url_encode(temp_service->event_handler),(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED");
+ else printf("Event Handler: %s
\n",(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED",(temp_svcstatus->event_handler_enabled)?"ENABLED":"DISABLED");
printf("Flap Detection: %s
\n",(temp_svcstatus->flap_detection_enabled==TRUE)?"ENABLED":"DISABLED",(temp_svcstatus->flap_detection_enabled==TRUE)?"ENABLED":"DISABLED");