I'm having a hard time understanding how to create a hostgroup and add nodes to it. I was trying to look at the documentation but, it does not explain where this needs to be done and if either in master and node or just one.

I want to create a group and all the hadoop servers to it. I was looking in here http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2-first-steps#groups-conf

but, still lost. Do I have this group in /etc/icinga2/conf.d/groups.conf and the on the host too? does anyone have a example config?


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.

|improve this answer|||||
  • Where you you create the hostgroups.conf? – Sergio Gadaleta Sep 26 '17 at 12:50
  • @SergioGadaleta In some config directory which is included via the main config. – gf_ Sep 26 '17 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.