Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #2689] Servicegroup Summary page displays wrong totals under "Service Status Summary" #1007

Closed
icinga-migration opened this issue Jun 14, 2012 · 5 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/2689

Created by ziesemer on 2012-06-14 20:16:17 +00:00

Assignee: ricardo
Status: Resolved (closed on 2012-06-18 11:52:09 +00:00)
Target Version: 1.7.1
Last Update: 2014-12-08 09:42:46 +00:00 (in Redmine)

Icinga Version: 1.10.0
OS Version: any

When viewing the "Servicegroup Summary" page (titled "Status Summary For All Service Groups") - the counts listed under "Host Status Summary" are correct, but not for "Service Status Summary". I.E., a box may show "20 OK", but clicking on it will only list 10 services (including "Results 1 - 10 of 10 Matching Services" displayed at the bottom).

This appears to be a bug in status.cgi, in the show_servicegroup_service_totals_summary function. This function is almost a clone of show_servicegroup_host_totals_summary - just dealing with services instead of hosts. (Seems like a good opportunity for some re-factoring here...) The host function includes a check for "skip this if it isn't a new host" - but this check doesn't exist in the service function. Patching the service function with the same check appears to fix the issue, without causing any additional issues. I've not examined the code thoroughly enough yet to properly explain why this works - but I'm assuming it relies on the list of members always coming back in a sorted order.

The patch I am using is attached - which is modified to apply cleanly to the icinga-1.7.0 release.

Also please review the attached serviceCountTest.cfg, which can be used to reproduce. This is an Icinga configuration file that is as minimal as I can make it. As long as you have a "linux-server" host template, "remote-service" service template, and a "check-host-alive" check command (defined in the default, "template" configuratoin files) - even if they don't do anything, you should easily be able to include this file into a test instance using cfg_file.

This file contains a total of 8 services. This mimics 2 production environments, each with an application and database tier, each with 2 nodes each. There is one top-level service group to easily allow the entire environment to have its notifications disabled, downtime scheduled, etc. - assuming there are multiple other similar configurations on the same Icinga instance.

An unpatched Icinga instance current displays this as the following (incorrectly), showing both the host status summary count + service status summary count:

serviceCountTest-prod (serviceCountTest-prod)           1 PENDING 16 PENDING
serviceCountTest-prod1 (serviceCountTest-prod1)         1 PENDING  8 PENDING
serviceCountTest-prod1-app (serviceCountTest-prod1-app) 1 PENDING  2 PENDING
serviceCountTest-prod1-db (serviceCountTest-prod1-db)   1 PENDING  2 PENDING
serviceCountTest-prod2 (serviceCountTest-prod2)         1 PENDING  8 PENDING
serviceCountTest-prod2-app (serviceCountTest-prod2-app) 1 PENDING  2 PENDING
serviceCountTest-prod2-db (serviceCountTest-prod2-db)   1 PENDING  2 PENDING

Note that there are 3 incorrect service counts here. There are only a total of 8 services defined, so serviceCountTest-prod should be 8, not 16. Also, both serviceCountTest-prod1 and serviceCountTest-prod2 should be 4, not 8. The supplied patch fixes each of these.

Note also that if I repeated the same configuration to exercise the host groups instead of the service groups, the host counts would be correct. This is because show_servicegroup_host_totals_summary already contains the logic contained within the patch, which is missing from show_servicegroup_service_totals_summary.

Please advise if there is any other details I can provide to assist in resolving this issue.

(This problem also exists in Nagios, and has an issue report (by me) at http://tracker.nagios.org/view.php?id=343.)

Attachments

Changesets

2012-06-15 04:29:12 +00:00 by ricardo 14d8a63

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

refs: #2689

kudos to ziesemer for supplying this patch
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-06-14 21:44:12 +00:00

  • Status changed from New to Assigned
  • Assigned to set to ricardo

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-06-14 21:47:18 +00:00

thanks, i will have a look when i have more time. in the meanwhile, ricardo will have a look ;)

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-06-15 04:30:11 +00:00

  • Status changed from Assigned to Feedback
  • Target Version set to 1.7.1
  • Done % changed from 0 to 90

fixed in current "rbartels/cgi"

thanks for reporting and the patch, makes things much easier :)

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-06-18 11:52:09 +00:00

  • Status changed from Feedback to Resolved
  • Done % changed from 90 to 100

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-12-08 09:42:47 +00:00

  • Project changed from 19 to Core, Classic UI, IDOUtils
  • Category changed from 54 to Classic UI
  • Icinga Version set to 1
  • OS Version set to any

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant