ubuntumonitoringicingaicinga2

How to add hosts to Icinga2?


I'm having problem adding a host to Icinga2. I know that it is possible to add it via the following command:

icinga2 node wizard

But I have a feeling that you could add the hosts yourself, choosing which services you would like to monitor and giving your host special names and attributes. I can't seem to find those options when I add them using via the node wizard.

Do you have a clue on how to add a host without using the node wizard?

Best regards, Eric


Solution

  • You need to do some background reading of the Icinga2 docs. Its very different from the old version and of Nagios.

    This is a very simple example taken from section 3.1 of the docs

    object Host "my-server1" {
      address = "10.0.0.1"
      check_command = "hostalive"
    }
    
    object Service "ping4" {
      host_name = "my-server1"
      check_command = "ping4"
    }
    
    object Service "http" {
      host_name = "my-server1"
      check_command = "http"
    }
    

    This would create a host called my-server1 with the IP of 10.0.0.1 checking it for ICMP and HTTP. There are a lot of options and a lot of setup required so you need to get familiar with the general config arrangements and directives of Icinga2. If you have a general grasp but want to know about setting up the config files see section 4 of the docs.