Service assignment related problem

This forum was archived to /woltlab and is now in read-only mode.
  • Above portion is to assign service ping4 to all host where host.address is availabe.
    How about if I create new service with API? Can I assign that service to all host with condition?

  • An apply rule is a factory that creates (in this case) service objects.
    The API also can create objects.

    Because an apply rule is not an object, it can not be created with the API.

    May be the use of filters with api calls can help.
    These allow to specify on which subset of (filtered) objects an api call will operate.…2-api#icinga2-api-filters

  • PUT requests do not allow filters as objects need to be created one-by-one (transaction safe). You can of course manage your static apply rules with API config packages, and then further create Host objects providing the attributes matching the assign-where expressions. Or you'll keep your apply rules statically as files on disk, and just let the API receive host object PUT requests.