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

[dev.icinga.com #2323] Truncated HTML table when displaying outages in outages.cgi #865

Closed
icinga-migration opened this issue Feb 17, 2012 · 13 comments
Milestone

Comments

@icinga-migration
Copy link

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

Created by techstone on 2012-02-17 07:23:15 +00:00

Assignee: ricardo
Status: Resolved (closed on 2012-04-13 16:04:26 +00:00)
Target Version: 1.7
Last Update: 2014-12-08 09:42:31 +00:00 (in Redmine)

Icinga Version: 1.10.0
OS Version: any

When two Blocking Outages are currently active and the user triggers the outages.cgi, only the first outage is displayed; the second HTML row is truncated after the first cell.

To reproduce:

  1. Create four hosts (dummy1, dummy2, subdummy1 and subdummy2) and configure a PING check for each. Make subdummy1 a child of dummy1 and subdummy2 a child of dummy2. Make sure the address of each host is not pingable.
  2. Reload Icinga.
  3. Once Icinga reports 2 Blocking Outages in the Tactical Overview, click on the Blocking Outages item which will trigger outages.cgi.
  4. Only one of the outages should be displayed; the second HTML table row should be truncated.

This was tested on FreeBSD 8.2 and Icinga 1.6.1 compiled from scratch and on Arch Linux from Feb. 16th with Icinga 1.6.1 compiled from the AUR. Apache 2.22 was the web server in both cases. The bug was reproducible on both OSes.

I tried compiling the CGIs from Git with a checkout of test/cgis and got the same bug.

Attachments

Changesets

2012-03-13 23:09:32 +00:00 by ricardo 2191fc5

classic ui: fixed Truncated HTML table when displaying outages in outages.cgi #2323

refs: #2323

Was my mistake. Forgot to duplicate string. Ended up in a double free.

2012-04-28 09:05:54 +00:00 by ricardo 1c3a74c

classic ui: fixed Truncated HTML table when displaying outages in outages.cgi #2323

refs: #2323

Was my mistake. Forgot to duplicate string. Ended up in a double free.

Conflicts:

	Changelog
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-02-18 11:06:48 +00:00

  • Status changed from New to Assigned
  • Assigned to set to ricardo
  • Target Version set to 1.7

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-02-24 17:35:51 +00:00

  • File added status_map.jpg
  • Status changed from Assigned to Feedback

Hi,

thank you for your detailed report. Unfortunately I can't reproduce the bug.

The attached picture represents my current test setup.

To me it "the second HTML row is truncated after the first cell" sounds more like a problem to free memory properly.

Can you submit some config's where you can reproduce the problem on your system and I can have a look how my system behaves.

what you can try as well is to uncomment following lines at the end of display_network_outages

    free_hostoutage_list();
    free_hostoutagesort_list();

thanks a lot

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-02-24 17:38:58 +00:00

status_map.jpg

@icinga-migration
Copy link
Author

Updated by techstone on 2012-02-26 18:03:40 +00:00

Hi Ricardo,

The setup I used to create the issue on an Arch Linux system uses all default configuration files from the 1.6.1 tarball but only changes the localhost.cfg file with the following diff:

--- localhost.cfg.sample        2012-02-15 15:46:34.000000000 -0500
+++ localhost.cfg       2012-02-26 12:32:09.457979722 -0500
@@ -29,10 +29,46 @@
         address                 127.0.0.1
         }

+define host{
+        use                     linux-server            ; Name of host template to use
+                                                        ; This host definition will inherit all variables that are defined
+                                                        ; in (or inherited by) the linux-server host template definition.
+        host_name               10.120.120.4
+        alias                   10.120.120.4
+        address                 10.120.120.4
+        }
+
+define host{
+        use                     linux-server            ; Name of host template to use
+                                                        ; This host definition will inherit all variables that are defined
+                                                        ; in (or inherited by) the linux-server host template definition.
+        host_name               10.120.120.5
+        alias                   10.120.120.5
+        address                 10.120.120.5
+        }
+
+define host{
+        use                     linux-server            ; Name of host template to use
+                                                        ; This host definition will inherit all variables that are defined
+                                                        ; in (or inherited by) the linux-server host template definition.
+        host_name               10.120.120.6
+        alias                   10.120.120.6
+       parents                 10.120.120.4
+        address                 10.120.120.6
+        }
+
+define host{
+        use                     linux-server            ; Name of host template to use
+                                                        ; This host definition will inherit all variables that are defined
+                                                        ; in (or inherited by) the linux-server host template definition.
+        host_name               10.120.120.7
+        alias                   10.120.120.7
+       parents                 10.120.120.5
+        address                 10.120.120.7
+        }
+


-###############################################################################
-###############################################################################
 #
 # HOST GROUP DEFINITION
 #

Note that the 10.120.120.X addresses point to non-existent servers.

Also, the calls to free_hostoutage_list() and free_hostoutagesort_list() at the end of the display_network_outages function in the outages.c file in my 1.6.1 are not commented out (I'm not a C programmer so if I misunderstood what you wanted me to do bear with me :o) ):

        /* free memory allocated to the host outage list */
        free_hostoutage_list();
        free_hostoutagesort_list();

        return;

I'll attache a few screenshots that show my test setup and the issue.

Thanks, and regards,
-Martin

@icinga-migration
Copy link
Author

Updated by techstone on 2012-02-26 18:06:07 +00:00

  • File added tactical_overview.png
  • File added missing_second_blocking_outage.png
  • File added status_map.png

Here are some screenshots that show my test setup:

tactical_overview.png

missing_second_blocking_outage.png

status_map.png

-Martin

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-03-12 23:12:22 +00:00

Hi,

sorry for letting you wait. What I meant was:

       /* free memory allocated to the host outage list */
//        free_hostoutage_list();
//        free_hostoutagesort_list();

        return;

can you change your code as above and recompile it, to see if anything changes?

Thanks for your help.

Cheers Ricardo

@icinga-migration
Copy link
Author

Updated by techstone on 2012-03-13 04:44:00 +00:00

Hi Ricardo,

Yes, commenting both freeing functions as you requested above and recompiling outages.cgi eliminates the issue. Swapping back to the original outages.cgi brings back the issue.

-Martin

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-03-13 23:17:42 +00:00

  • Subject changed from Truncated HTML table when displaying two active outages in outages.cgi to Truncated HTML table when displaying outages in outages.cgi
  • Done % changed from 0 to 90

Hi,

found it!

When I added the feature to acknowledge all affected hosts at once, I did a mistake. This caused a double free and the result you experienced.

Fixed this in current "rbartels/cgi". Can you check if this solves the problem for you?

Sorry again and thanks for the help to find the bug.

Cheers RIcardo

@icinga-migration
Copy link
Author

Updated by techstone on 2012-03-14 05:21:32 +00:00

Hi Ricardo,

I compiled outages.cgi from "rbartels/cgi" and that CGI solves the problem as well.

I think it's all good now.

On a side note, and as an FYI, I did notice some similar behavior (truncated tables) with notifications.cgi but it only seemed to occur randomly. I do remember a day when the notifications tables for that day looked fine, then I restarted Icinga after some config changes, and when I checked the notifications table for that same day again it was truncated. I don't know if it's all related with the restart of the Icinga daemon, or maybe the presence of some specific item in the log following the restart, but since I couldn't easily reproduce it I decided not to mention it originally.

Thanks again for fixing outages.cgi!

-Martin

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-03-14 06:18:37 +00:00

this should be solved with #2234

Thanks for testing.

Cheers Ricardo

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-04-03 13:54:40 +00:00

looks fine from my dev box.

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-04-13 16:04:26 +00:00

  • Status changed from Feedback to Resolved

should be fine now

@icinga-migration
Copy link
Author

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

  • Project changed from 19 to Core, Classic UI, IDOUtils
  • Category set 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