Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 202 forks source link

hosts which have "applied groups" are not shown in hostgroup list #2092

Open OG2K opened 4 years ago

OG2K commented 4 years ago

Annotation 2020-03-03 100257 - hg ALL-PRODUCTION overview

Expected Behavior

hosts which have "applied groups" will be shown in hostgroup list

Current Behavior

hosts which have "applied groups" are not shown in hostgroup list

Possible Solution

adjust sql query to filter by "hostgroup" and "applied group" (JOIN)"

Steps to Reproduce (for bugs)

chapter 1 1) create hostgroup "ALL-PRODUCTION" with assign where = "host.vars.STATUS = PRODUCTION" 2) create host "dummyhost" with custom property STATUS = PRODUCTION, do not add host into hostgroup "ALL-PRODUCTION" 3) store host and check that applied group has "ALL-PRODUCTION" 4) deploy config 5) overview, hostgroups, "ALL-PRODUCTION" /icingaweb2/director/hostgroups#!/icingaweb2/director/hostGroup?name=ALL-PRODUCTION 6) "dummyhost" is not visible

chapter 2 1) edit host "dummhost" 2) empty custom property STATUS. 3) store host and check that applied group has no "ALL-PRODUCTION" anymore 4) add to groups "ALL-PRODUCTION" 5) store, deploy 6) overview, hostgroups, "ALL-PRODUCTION" 7) "dummyhost" is visible

Your Environment

cinga Web 2 Version 2.7.3 Git commit 06cabfe8ba28cf545a42c92f25484383191a4e51 PHP Version 7.1.30 Git commit date 2019-10-18 Copyright © 2013-2020 The Icinga Project

icinga2 --version icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.2-1)

System information: Platform: Red Hat Enterprise Linux Server Platform version: 7.7 (Maipo) Kernel: Linux Kernel version: 3.10.0-1062.12.1.el7.x86_64 Architecture: x86_64

Build information: Compiler: GNU 4.8.5 Build host: runner-LTrJQZ9N-project-322-concurrent-0

Webserver, PHP versions: httpd -v Server version: Apache/2.4.6 (Red Hat Enterprise Linux) Server built: Jun 9 2019 13:01:04

steaksauce- commented 4 years ago

I too am having this bug. It appears that the hosts I am trying to create are not getting created, so there is no host group. Deployment executes fine and the host/hostgroup are both in /var/lib/icinga2/api as are the rest of my director objects.

Director version 1.7.2

steaksauce- commented 4 years ago

My issue seemed relates, but was not.

We had restrictions on viewable host/service groups based on ones AD group. Even though I was an administrator, I could not see all groups. Tracking down if I was a member of an offending group and will open a different issue if there is one.

OG2K commented 4 years ago

Heureka. I figured it out.

Value of custom property is a datalist. That is why asterisks should be used around pattern. I could not achieve same result using "in", "contain" operands.

Annotation 2020-03-19 100153 - hostgroup pattern needs asterisks Annotation 2020-03-19 100529 - hostgroup pattern needs astirisks works in combinations Annotation 2020-03-19 100819 - hostgroups - overview

as going more into inventory and showing status on overview dashboard:

Annotation 2020-03-19 101309 - by family

BR /A

steaksauce- commented 4 years ago

I just found that we are having the same issue in 2.7.3 -- we are applying the group during the director sync based off a property though.

The real kicker is, I'm using the exact same sync and hostgroup rules as I am in our production 2.7.2 instance, where we don't have this problem.

steaksauce- commented 4 years ago

Well again I overlooked a detail -- the service group apply was messed up on my end -_-

Tqnsls commented 3 years ago

@OG2K Hi Anton, so the issue is solved than?

OG2K commented 3 years ago

Dear Tqnsls, Yes, it self-resolved :)) but logically thinking - not. :) Let's leave it open, when/if it comes actual for development. BR /A

crayt90 commented 2 years ago

Heureka. I figured it out.

Value of custom property is a datalist. That is why asterisks should be used around pattern. I could not achieve same result using "in", "contain" operands.

I'm facing this exact issue, even if adding the asterisks.

Adding the group directly to the host, shows the host in the correct Hostgroup. Having the group assigned by the template via "applied where" shows the group correctly in "Applied groups" but not in the Hostgroup.

I'm using :

AlmaLinux release 8.5 (Arctic Sphynx) with icinga-rpm-release-8-4.el8.icinga.noarch Icinga2 version 2.9.5 IcingaWeb2 version 2.9.5 Director version 1.9.0

Any help is greatly appreciated.

BR

crayt90

djkerya commented 4 weeks ago

I have a similar bug, or maybe the same. I create a hostgroup, set apply rule with conditions based on host.name, members tab shows all hosts according to conditions, but the search either shows no hosts in the group or a random amount.

icinga web 2.11.1 director 1.9.1