[icinga-users] Hosts are not moved into new groups via assign where clause in icinga 2

Rune 'TheFlyingcorpse' Darrud theflyingcorpse at gmail.com
Mon Aug 4 20:16:14 CEST 2014


Uhm, might it be because you mix up the vars?

object HostGroup "network-switches" {
....

  assign where host.vars.type == "switch"

}
Is not the same as
.....
object Host "switch22" {

  vars.host_type = "switch"

}


I'd expect that statement  to be host.vars.host_type in object HostGroup.



How does that work for you?






On 4 August 2014 20:10, Gaston Gloesener <gaston.gloesener at web.de> wrote:

> I am currently trying some alternatives for network monitoring and now am
> with a brand new installation of icinga 2.0.1 and icinga-web 1.11.1.
>
>
>
> I have tried to create new hostgroups by editing groups.conf and adding
> like:
>
>
>
> object HostGroup "network-switches" {
>
>   display_name = "Network Switches"
>
>
>
>   assign where host.vars.type == "switch"
>
> }
>
>
>
> Then the file defining the actual switch:
>
>
>
> object Host "switch22" {
>
>   import "generic-switch"
>
>
>
>   address = "10.1.0.22"
>
>
>
>   vars.os = "Netgear"
>
>   vars.sla = "24x7"
>
>   vars.host_type = "switch"
>
> }
>
>
>
> The hosts appear in icinga-web, but not the host groups. Previously I have
> added linux servers which did correctly group in the predefined
> linux-servers group .
>
>
>
> Icinga2 --validate, validates the configuration, and I have tried to send
> SIGHUP as well as restarting icinga2.
>
>
>
> The validation message confirms that all 4 groups have been read:
>
>
>
> [2014-08-04 20:04:08 +0200] information/ConfigItem: Checked 4
> HostGroup(s).
>
>
>
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20140804/801603fd/attachment.html>


More information about the icinga-users mailing list