Hi,
Am 11.02.2015 um 09:20 schrieb Michael Friedrich:
> Am 11.02.2015 um 01:38 schrieb Dustin Funk:
>> Hi,
>>
>> Am 09.02.2015 um 11:46 schrieb Dustin Funk:
>>> Am 09.02.2015 um 07:56 schrieb Michael Friedrich:
>>>> Am Montag, 9. Februar 2015 schrieb Dustin Funk :
>>>> Am 08.02.2015 um 21:15 schrieb Michael Friedrich:
>>>> > Am Sonntag, 8. Februar 2015 schrieb Dustin Funk :
>>>> >
>>>> > Hi,
>>>> >
>>>> >
>>>> > can i write the following dependency definitions in a
>>>> shorter way?
>>>> >
>>>> >
>>>> > 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 = "d-switch-2"
>>>> > }
>>>> >
>>>> > apply Dependency "switche" to Host {
>>>> > # parent_host_name = "$vars.parent$"
>>>> > parent_host_name = "d-switch-1"
>>>> > assign where host.vars.parent == "d-switch-1"
>>>> > }
>>>> >
>>>> >
>>>> > Using 2.2.x try
>>>>
>>>> Sorry, 2.2.4.
>>>>
>> Sorry again, 2.2.3.
>>
>>>> >
>>>> > parent_host_name = host.vars.parent
>>>>
>>>> I try the following lines:
>>>>
>>>>
>>>> Why don't you use my exact proposal?
>>>>
>>> because it also outputs error(s)
>>>
>>>
>>> apply Dependency "switche" to Host {
>>> parent_host_name = host.vars.parent
>>> assign where host.vars.parent
>>> }
>>>
>>>
>>> critical/config:
>>> 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 warnings.
>>>
>>>
>> Unfortunately, I have not made any progress.
>> Any advices?
>
> There might be a problem with empty values in assignments, try 'assign
> where host.vars.parent != ""'
>
That's it!
absolute values works like:
assign where host.vars.parent == "d-switch-2"
but
assign where host.vars.parent
did not work, also
assign where host.vars.parent != ""
'match' also works well!
Many thanks!
Is that a bug? Should i open an issue?
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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ icinga-users mailing list [email protected] https://lists.icinga.org/mailman/listinfo/icinga-users
