Am 11.02.2015 um 13:02 schrieb icinga-users:
> Hi,
> 

Hi,

> On 2015-02-11 12:57, Dustin Funk wrote:
>>
>> Is that a bug? Should i open an issue?
> 
> This works for me:
> 
> # cat hosts.conf
> object Host "host-remote" {
>   import "generic-host"
>   address = "10.42.48.1"
> }
> 
> object Host "d-switch-1" {
>   import "generic-host"
>   address = "10.42.49.1"
>   vars.parent = "host-remote"
> }
> 
> object Host "d-switch-2" {
>   import "generic-host"
>   address = "10.42.49.2"
>   vars.parent = "d-switch-1"
> }
> 
> object Host "d-switch-3" {
>   import "generic-host"
>   address = "10.42.49.3"
>   vars.parent = ""
> }
> 
> apply Dependency "switche" to Host {
>   parent_host_name = host.vars.parent
>   assign where host.vars.parent
> }

Thank you!

Simply c&p this config in my file also leads to an error.


object Host "d-switch-1" {
  import "generic-host"
  address = "10.42.49.1"
  vars.parent = "host-remote"
}

object Host "d-switch-2" {
  import "generic-host"
  address = "10.42.49.2"
  vars.parent = "d-switch-1"
}

object Host "d-switch-3" {
  import "generic-host"
  address = "10.42.49.3"
  vars.parent = ""
}

apply Dependency "switche" to Host {
  parent_host_name = host.vars.parent
  assign where host.vars.parent
}


Config error: Invalid value for attribute: Object 'switche' (Type:
'Dependency') at /etc/icinga2/conf.d/switche/passive-technik.conf:22 ->$
critical/config: 1 errors, 0 warning

Line 22 is the 'apply Dependency' line


# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.2.3-1)

Gentoo-Linux


Kind regards,
  nuts


> 
> # service icinga2 checkconfig
> [ ok ] checking Icinga2 configuration.
> 
> # icinga2 object list --type 'Dependency'
> Object 'd-switch-1!switche' of type 'Dependency':
>   * __name = "d-switch-1!switche"
>   * child_host_name = "d-switch-1"
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 57:1-57:34
>   * child_service_name = ""
>   * disable_checks = false
>   * disable_notifications = true
>   * name = "switche"
>   * parent_host_name = "host-remote"
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 58:3-58:37
>   * parent_service_name = ""
>   * period = ""
>   * states = null
>   * templates = [ "switche" ]
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 57:1-57:34
>   * type = "Dependency"
>   * vars = null
>   * zone = ""
> 
> Object 'd-switch-2!switche' of type 'Dependency':
>   * __name = "d-switch-2!switche"
>   * child_host_name = "d-switch-2"
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 57:1-57:34
>   * child_service_name = ""
>   * disable_checks = false
>   * disable_notifications = true
>   * name = "switche"
>   * parent_host_name = "d-switch-1"
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 58:3-58:37
>   * parent_service_name = ""
>   * period = ""
>   * states = null
>   * templates = [ "switche" ]
>     % = modified in '/etc/icinga2/my-conf.d/hosts.conf', lines 57:1-57:34
>   * type = "Dependency"
>   * vars = null
>   * zone = ""
> 
> # icinga2 --version
> icinga2 - The Icinga 2 network monitoring daemon (version: r2.2.3-1)
> 
>>
>>
>> Kind regards,
>>   nuts
>>
>>
>>
>>> Other than that, it will work as expected, check the documentation.
>>> http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#dependencies-apply-custom-attributes
>>>
>>>
>>>
>>> Kind regards,
>>> Michael
>>>
>>>
>>> -- 
>>> Michael Friedrich, DI (FH)
>>> Application Developer
>>>
>>> NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
>>> Tel: +49 911 92885-0 | Fax: +49 911 92885-77
>>> GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
>>> http://www.netways.de | [email protected]
>>>
>>> ** CeBIT 2015 - 16.-20. März 2015 - http://www.netways.de/cebit **
>>> ** OSDC 2015 - April - osdc.de **
>>> ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp **
>>> ** OSBConf 2015 - September - osbconf.org **
>>> _______________________________________________
>>> icinga-users mailing list
>>> [email protected]
>>> https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>
>> _______________________________________________
>> icinga-users mailing list
>> [email protected]
>> https://lists.icinga.org/mailman/listinfo/icinga-users
> 
> Regards
> Tobias
> _______________________________________________
> icinga-users mailing list
> [email protected]
> https://lists.icinga.org/mailman/listinfo/icinga-users


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to