Hostgroups and assigns via API

This forum was archived to /woltlab and is now in read-only mode.
  • In my setup, we have buildings, telecom closets and then hosts in those closets. The list of buildings, closets and hosts are imported from a database every two hours and they change dynamically.


    We currently use flat config files for this part of our setup but I want to convert this to use API as I do for everything else. This is my last hurdle!


    How can I manage the "assign where" lines inside hostgroups via the API? Is there any way yet?


    object HostGroup "building_000300" {
    assign where host.vars.building == "000300"
    }


    object HostGroup "closet_148" {
    assign where host.vars.closet == "148"
    }


    object Host "lab-sw1" {
    import "cisco_switch"
    address = "10.2.2.22"
    vars.building = "000300"
    vars.closet = "148"
    vars.device_type = "cisco_switch"
    }

  • Ok, hopefully this will arrive in the API one day...


    I'm trying to get to the point that I don't have to reload my icinga config and have everything done through the API.


    Thanks