[icinga-checkins] icinga.org: icinga-core/mfriedrich/cgis: classic-ui: added service / host properties to links in status totals

git at icinga.org git at icinga.org
Thu Apr 19 12:07:14 CEST 2012


Module: icinga-core
Branch: mfriedrich/cgis
Commit: 4c1061883bdfa20a4731f37f16477b6ef029dab7
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=4c1061883bdfa20a4731f37f16477b6ef029dab7

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Tue Mar 20 22:30:20 2012 +0100

classic-ui: added service / host properties to links in status totals

refs: #1524

* now serviceprops and hostprops are added to links in status totals if they were set in the request
* let's see how this is doing

---

 cgi/status.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/cgi/status.c b/cgi/status.c
index b7e07c4..9ef4d30 100644
--- a/cgi/status.c
+++ b/cgi/status.c
@@ -1804,6 +1804,7 @@ void show_service_status_totals(void) {
 	int num_services_unfiltered = 0;
 	int num_problems_unfiltered = 0;
 	char status_url[MAX_INPUT_BUFFER];
+	char temp_buffer[MAX_INPUT_BUFFER];
 	char *style = NULL;
 
 	if (display_status_totals == FALSE || group_style_type == STYLE_HOST_DETAIL)
@@ -1836,9 +1837,23 @@ void show_service_status_totals(void) {
 	else
 		snprintf(status_url, sizeof(status_url) - 1, "%s?%s%s%s&style=%s&hoststatustypes=%d", STATUS_CGI, url_hostgroups_part, (service_filter != NULL) ? "&servicefilter=" : "", (service_filter != NULL) ? url_encode(service_filter) : "", style, host_status_types);
 
+	my_free(style);
+
 	status_url[sizeof(status_url)-1] = '\x0';
 
-	my_free(style);
+	if (service_properties != 0 && display_all_unhandled_problems == FALSE) {
+		snprintf(temp_buffer, sizeof(temp_buffer) - 1, "&serviceprops=%lu", service_properties);
+		temp_buffer[sizeof(temp_buffer)-1] = '\x0';
+		strncat(status_url, temp_buffer, sizeof(status_url) - strlen(status_url) - 1);
+		status_url[sizeof(status_url)-1] = '\x0';
+	}
+
+	if (host_properties != 0) {
+		snprintf(temp_buffer, sizeof(temp_buffer) - 1, "&hostprops=%lu", host_properties);
+		temp_buffer[sizeof(temp_buffer)-1] = '\x0';
+		strncat(status_url, temp_buffer, sizeof(status_url) - strlen(status_url) - 1);
+		status_url[sizeof(status_url)-1] = '\x0';
+	}
 
 	/* display status totals */
 	printf("<DIV CLASS='serviceTotals'>Service Status Totals</DIV>\n");
@@ -1957,6 +1972,20 @@ void show_host_status_totals(void) {
 		status_url[sizeof(status_url)-1] = '\x0';
 	}
 
+	if (service_properties != 0) {
+		snprintf(temp_buffer, sizeof(temp_buffer) - 1, "&serviceprops=%lu", service_properties);
+		temp_buffer[sizeof(temp_buffer)-1] = '\x0';
+		strncat(status_url, temp_buffer, sizeof(status_url) - strlen(status_url) - 1);
+		status_url[sizeof(status_url)-1] = '\x0';
+	}
+
+	if (host_properties != 0 && display_all_unhandled_problems == FALSE) {
+		snprintf(temp_buffer, sizeof(temp_buffer) - 1, "&hostprops=%lu", host_properties);
+		temp_buffer[sizeof(temp_buffer)-1] = '\x0';
+		strncat(status_url, temp_buffer, sizeof(status_url) - strlen(status_url) - 1);
+		status_url[sizeof(status_url)-1] = '\x0';
+	}
+
 	/* display status totals */
 	printf("<DIV CLASS='hostTotals'>Host Status Totals</DIV>\n");
 





More information about the icinga-checkins mailing list