[icinga-checkins] icinga.org: icinga-core/dev/core: classic-ui: fixed Double-listed host dependencies in host extinfo.cgi again #3295

git at icinga.org git at icinga.org
Thu Jan 10 20:23:51 CET 2013


Module: icinga-core
Branch: dev/core
Commit: c211794916072e7fe5f65f7df0a5fdadeac2995b
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=c211794916072e7fe5f65f7df0a5fdadeac2995b

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Thu Dec 20 18:04:51 2012 +0100

classic-ui: fixed Double-listed host dependencies in host extinfo.cgi again #3295

refs: #3295

should be fixed now for host dependencies and service dependencies

---

 cgi/extinfo.c |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index 0ea5769..451800f 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -471,14 +471,16 @@ int main(void) {
 
 				for (temp_hd = hostdependency_list; temp_hd != NULL; temp_hd = temp_hd->next) {
 
-					if (!strcmp(temp_hd->dependent_host_name, temp_host->name) && !strcmp(temp_hd->host_name, last_hd_hostname)) {
-						if (found == TRUE)
-							printf(", ");
+					if (!strcmp(temp_hd->dependent_host_name, temp_host->name)) {
+						if (!strcmp(temp_hd->host_name, last_hd_hostname)) {
+							if (found == TRUE)
+								printf(", ");
 
-						printf("<A HREF='%s?type=%d&host=%s'>%s</A>\n", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_hd->host_name), html_encode(temp_hd->host_name, FALSE));
-						found = TRUE;
+							printf("<A HREF='%s?type=%d&host=%s'>%s</A><BR>\n", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_hd->host_name), html_encode(temp_hd->host_name, FALSE));
+							found = TRUE;
+						}
+						last_hd_hostname = temp_hd->host_name;
 					}
-					last_hd_hostname = temp_hd->host_name;
 				}
 
 				if (found == FALSE)
@@ -526,17 +528,18 @@ int main(void) {
 
 				for (temp_sd = servicedependency_list; temp_sd != NULL; temp_sd = temp_sd->next) {
 
-					if (!strcmp(temp_sd->dependent_service_description, temp_service->description) && !strcmp(temp_sd->dependent_host_name, temp_host->name) && \
-					        !(!strcmp(temp_sd->service_description, last_sd_svc_desc) && !strcmp(temp_sd->host_name, last_sd_hostname))) {
-						if (found == TRUE)
-							printf(", ");
+					if (!strcmp(temp_sd->dependent_service_description, temp_service->description) && !strcmp(temp_sd->dependent_host_name, temp_host->name)) {
+					        if (!(!strcmp(temp_sd->service_description, last_sd_svc_desc) && !strcmp(temp_sd->host_name, last_sd_hostname))) {
+							if (found == TRUE)
+								printf(", ");
 
-						printf("<A HREF='%s?type=%d&host=%s", EXTINFO_CGI, DISPLAY_SERVICE_INFO, url_encode(temp_sd->host_name));
-						printf("&service=%s'>%s on %s</A>\n", url_encode(temp_sd->service_description), html_encode(temp_sd->service_description, FALSE), html_encode(temp_sd->host_name, FALSE));
-						found = TRUE;
+							printf("<A HREF='%s?type=%d&host=%s", EXTINFO_CGI, DISPLAY_SERVICE_INFO, url_encode(temp_sd->host_name));
+							printf("&service=%s'>%s on %s</A>\n", url_encode(temp_sd->service_description), html_encode(temp_sd->service_description, FALSE), html_encode(temp_sd->host_name, FALSE));
+							found = TRUE;
+						}
+						last_sd_svc_desc = temp_sd->service_description;
+						last_sd_hostname = temp_sd->host_name;
 					}
-					last_sd_svc_desc = temp_sd->service_description;
-					last_sd_hostname = temp_sd->host_name;
 				}
 
 				if (found == FALSE)





More information about the icinga-checkins mailing list