Icinga / icingaweb2-module-cube

Drill-down view for Icinga web 2 based on custom variables
GNU General Public License v2.0
45 stars 12 forks source link

Host cubes displays number of services instead of number of hosts #98

Closed tfylling closed 10 months ago

tfylling commented 1 year ago

Describe the bug

When I create a host cube and select a host variable, the slices show the number of services on the matching hosts instead of the number of hosts. This also takes a lot more time than it ought to if it was just iterating over the hosts. Also just loading the Hosts-tab in the Cube page takes quite a while. Clicking the name of the slice give a host list with just the relevant host as expected. It seems to me that both in showing the cube and in fetching the dimension options for a cube it iterates over the service objects, using their host variables, rather than the host objects, but this is just conjecture.

To Reproduce

  1. Create a new cube
  2. Select the Hosts tab
  3. Add a dimension, custom variable or otherwise
  4. Observe that the slices show numbers of services who's host match the criteria

Expected behavior

The slices should show the number of hosts matching the criteria. For example the Darwin slice in the screenshot below should show 6, not 116, which is the total number of services on those six hosts.

Screenshots

image

Your Environment

Include as many relevant details about the environment you experienced the problem in

nilmerg commented 1 year ago

Since you didn't include which cube version you have, make sure to install the latest and report back.

tfylling commented 1 year ago

Sorry, yes. It wasn't a part of the bug template, so I forgot to include it. cube version is 1.2.2, which is the latest version as far as I understand. More precisely it's 1.2.2-1+ubuntu22.04 instealled from the icinga-jammy repo.

nilmerg commented 1 year ago

Is this a PostgreSQL database backend by chance?

tfylling commented 1 year ago

It is, yes.

nilmerg commented 1 year ago

Confirmed. Though, I had to configure a restriction first (Using servicegroup_name)

nilmerg commented 1 year ago

I'm afraid, but I cannot reproduce it anymore. I'm sure I was able to, but I tried every possible combination of:

None showed the described issue. Please wait for the next release, try it again and report back.

tfylling commented 1 year ago

I think this may now have resolved itself. I wish I could be certain, but after an update of icinga shortly after the cubemodule now just says.

Trait "Icinga\Module\Icingadb\Common\Auth" not found

#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main

I've not found much relevant help on this from google, so I should probably create a separate issue for this, unless it's a known easy fix.

Edit: I should probably add that I don't use IcingaDB, and I'm hesitant to jump in. Too many bad experiences with Redis in the past.