Icingaweb2 (web interface) is used only as view to the Icinga2 (monitoring core) state.
You can create your hostgroups in any configuration file you want. The recommended way is to use some sort of tagging at the Host level and add rules to HostGroup
This example is taken from default Icinga2 configs ( hostgroups.conf
).
object HostGroup "windows-servers" {
display_name = "Windows Servers"
assign where host.vars.os == "Windows"
}
On the host config, you just create
object Host "ad.acme.com" {
display_name = "AD server"
vars.os = "Windows"
}
The latter will create new host with host variable os
set to "Windows". The first block will create hostgroup from all hosts which has their os
variable set to "Windows".
You should also make sure that your definition are correctly understood by Icinga2. Try following commands at your Icinga2 host:
icinga2 object list
# this will show all objects from your configs
icinga2 object list --type=host
# this will show all Host objects from your configs
icinga2 object list --type=host --name=ad.acme.com
# this will show host ad.acme.com how Icinga2 understood you
Same applies for hostgroups
When your hosts are correctly parsed by Icinga daemon, you should also make sure, that permissions in your Icingaweb2 are set correctly.