Am 14.04.2015 um 11:43 schrieb Michael Pfeiffer:
> Hi nuts,
> 

Hi,

> On 2015-04-14 01:15:43, Dustin Funk wrote:
>> object Host "name" {
>>   import "generic-host"
>>   address = "111.222.333.444"
>>
>>   vars.dns["dns server"] = {
>>         dns_lookup = "$address$"
>>         dns_server = "www.fem.tu-ilmenau.de"
>>   }
>> }
>>
>> apply Service "dns" for (dns_name => config in host.vars.dns) {
>>   import "generic-service"
>>   vars += config
>>
>>   display_name = dns_name
>>   check_command = "dns"
>>
>>   assign where host.vars.dns
>> }
> 
> I am really anything else than an expert in icinga2 config, but in my 
> understanding, macros are used for accessing variables of *other* objects, 
> whereas you are trying to access a variable of the Host object itself.
> 
> Maybe you could try to move the line 'dns_lookup = "$address$"' to the 
> Service 
> definition, or access the address variable in the Host object without a macro?
> 

The thing is that i want apply rules instead of a service definition.

> Just a wild guess, I have not tried this, and if somebody with better 
> understanding of icinga2 is around, please feel very welcome to correct me ;-)

I hoped that there is more dynamic way. When i change the IP of a
server, i'll make the changes as less as possible.

Kindly regards,
  nuts


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