[icinga-checkins] icinga.org: icinga-core/r1.7: classic-ui: Fixed wrong totals in " Service Status Summary" on Status Summary page #2689 - ziesemer

git at icinga.org git at icinga.org
Fri Jun 15 17:19:49 CEST 2012


Module: icinga-core
Branch: r1.7
Commit: 14d8a637f41cea17a026f49f6969e69a8fac1d3d
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=14d8a637f41cea17a026f49f6969e69a8fac1d3d

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Fri Jun 15 06:22:20 2012 +0200

classic-ui: Fixed wrong totals in "Service Status Summary" on Status Summary page #2689 - ziesemer

refs: #2689

kudos to ziesemer for supplying this patch

---

 Changelog    |    1 +
 cgi/status.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Changelog b/Changelog
index 56d19b7..c59344c 100644
--- a/Changelog
+++ b/Changelog
@@ -10,6 +10,7 @@ FIXES
 * classic ui: Fixed status.cgi time out when displaying hostgroups in large environments #2617 - RB
 * classic ui: Fixed Invalid JSON output for hostgroup overview #2680 - trehn
 * classic ui: Fixed Confusing use of display_name in JSON and CSV output #2681 - trehn
+* classic ui: Fixed wrong totals in "Service Status Summary" on Status Summary page #2689 - ziesemer
 
 
 1.7.0 - 15/05/2012
diff --git a/cgi/status.c b/cgi/status.c
index 43e6bf1..4168bf4 100644
--- a/cgi/status.c
+++ b/cgi/status.c
@@ -3598,6 +3598,7 @@ void show_servicegroup_service_totals_summary(servicegroup *temp_servicegroup) {
 	int services_critical_unacknowledged = 0;
 	servicesmember *temp_member = NULL;
 	servicestatus *temp_servicestatus = NULL;
+	servicestatus *last_servicestatus = NULL;
 	hoststatus *temp_hoststatus = NULL;
 	int problem = FALSE;
 
@@ -3610,6 +3611,10 @@ void show_servicegroup_service_totals_summary(servicegroup *temp_servicegroup) {
 		if (temp_servicestatus == NULL)
 			continue;
 
+		/* skip this if it isn't a new service... */
+		if(temp_servicestatus == last_servicestatus)
+			continue;
+
 		/* find the status of the associated host */
 		temp_hoststatus = find_hoststatus(temp_servicestatus->host_name);
 		if (temp_hoststatus == NULL)
@@ -3704,6 +3709,8 @@ void show_servicegroup_service_totals_summary(servicegroup *temp_servicegroup) {
 
 		else if (temp_servicestatus->status == SERVICE_PENDING)
 			services_pending++;
+
+		last_servicestatus = temp_servicestatus;
 	}
 
 	if (content_type == JSON_CONTENT) {





More information about the icinga-checkins mailing list