1

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?

jlozadad
  • 13
  • 1
  • 5

1 Answers1

0

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.

Věroš K.
  • 500
  • 3
  • 9