> Thanks for the tip, are you able to provide an example of how to define 
> the services I want for my host using the technique you describe ?

You're nesting types without purpose, you don't use the dictionary
key for anything. You also only override a single element within your
dictionary.

If you do need overrides and simply did not show it, here are two
scenarios (untested) which build a dynamic service name:


***** no override facility ******

object Host "my-server" {
  ...
  vars.basic_partitions = [ "/", "/tmp", "/var", "/home" ]
  vars.other_partitions = [ "/var/lib/foo", "/var/lib/baz" ]
}

apply Service "basic disk " for (part in host.vars.basic_partitions) {
  ...

  // Leverage part against some check command...

  assign where host.vars.basic_partitions
}

apply Service "other disk " for (part in host.vars.otherc_partitions) {
  ...

  // Leverage part against some check command...

  assign where host.vars.other_partitions
}

***** with override facility ******

object Host "my-server" {
  ...
  vars.basic_partitions["/"] = {
    override_a = "foo"
    override_b = "bar"
  }
  vars.basic_partitions["/tmp"] = {
    override_a = "foo"
    override_b = "bar"
  }
  vars.basic_partitions["/var"] = {
    override_a = "foo"
    override_b = "bar"
  }
}

apply Service "basic disk " for (part => config in host.vars.basic_partitions) {
  ...
  // Leverage part against some check command...
  vars += config

  assign where host.vars.other_partitions
}
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to