Bug #2019

Wrong output from status.cgi with option hostservicedetail

Added by stku over 2 years ago. Updated over 2 years ago.

Status:ResolvedStart date:10/18/2011
Priority:NormalDue date:
Assignee:ricardo% Done:

100%

Category:-
Target version:Icinga 1.x - 1.6
Icinga Version: Browser Version:

Description

Hello, status.cgi with the option hostservicedetail into the section "Host Status Detail" also Service Problems will be displayed. If a host is down and all Services for this Host are Critical or Unknown which is normal. Then I get the Host in the section "Host Status Detail" displayed multiple times with state DOWN which is correct but also with Critical and Unknown which comes from the Services. With a small change in status.c the output will be correct.

My change on status.c

--- a/cgi/status.c
+++ b/cgi/status.c
@@ -655,6 +655,7 @@ int main(void) {
                        show_host_detail();
                else if (group_style_type == STYLE_HOST_SERVICE_DETAIL) {

+            group_style_type = STYLE_HOST_DETAIL;
                        show_host_detail();

                        /* only show service problems of Hosts which are
@@ -670,7 +671,10 @@ int main(void) {
                                printf("</td></tr></table>\n");
                        }

+            group_style_type = STYLE_SERVICE_DETAIL;
                        show_service_detail();
+            group_style_type = STYLE_HOST_SERVICE_DETAIL;
+
                } else
                        show_service_detail();
        } else if (display_type == DISPLAY_SERVICEGROUPS) {
@@ -5152,7 +5156,7 @@ void grab_statusdata(void) {
        temp_hostgroup = find_hostgroup(hostgroup_name);
        temp_servicegroup = find_servicegroup(servicegroup_name);

-       if (group_style_type == STYLE_HOST_DETAIL || group_style_type == STYLE_HOST_SERVICE_DETAIL) {
+       if (group_style_type == STYLE_HOST_DETAIL) {

                for (temp_hoststatus = hoststatus_list; temp_hoststatus != NULL; temp_hoststatus = temp_hoststatus->next) {

@@ -5193,7 +5197,7 @@ void grab_statusdata(void) {

                }
        }
-       if (group_style_type != STYLE_HOST_DETAIL || group_style_type == STYLE_HOST_SERVICE_DETAIL) {
+       if (group_style_type != STYLE_HOST_DETAIL) {
                if (service_filter != NULL)
                        regcomp(&preg, service_filter, 0);
                if (host_filter != NULL)

Associated revisions

Revision 1fc4e4b2
Added by ricardo over 2 years ago

classic-ui: fixed wrong output from status.cgi with option hostservicedetail #2019

refs: #2019

Thanks to stku

History

#1 Updated by ricardo over 2 years ago

  • Assignee set to ricardo
  • Target version set to 1.6

will have a look

#2 Updated by ricardo over 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

this is already fixed in current dev/cgis

#3 Updated by dnsmichi over 2 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF