Skip to content

icinga create-host

Creates a new host object


Creates a new host object


icinga create-host
    [--site <site>]
    [--cluster <cluster>]
    --name <name>
    [--templates <templates>]
    [--address <address>]
    [--groups <groups>]
    [--vars <vars>]
    --check_command <check_command>


site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default:      Attributes: optional

cluster - (string)

     Name of Icinga cluster
     Example: --cluster "icinga-default"
     Default: icinga-default      Attributes: optional

name - (string)

     Name of the host object
     Example: --name "example.localdomain"
     Default: _None_      Attributes: required

templates - (string)

     Import existing configuration templates for this object type. These templates must either be statically configured or provided in config packages
     Example: --templates "generic-host"
     Default: _None_      Attributes: optional, multiple allowed

ignore_on_err - (bool)

     If set, Ignore object creation errors and return an HTTP 200 status instead.
     Example: --ignore_on_err
     Default: _None_      Attributes: optional

address - (string)

     The host’s IPv4 address. Available as command runtime macro $address$ if set.
     Example: --address ""
     Default: _None_      Attributes: optional

groups - (string)

     A list of host groups this host belongs to
     Example: --groups "group1"
     Default: _None_      Attributes: optional, multiple allowed

vars - (string)

     A dictionary containing custom variables that are specific to this host.
     Example: --vars "{"os":"linux"}"
     Default: _None_      Attributes: optional

check_command - (string)

     The name of the check command.
     Example: --check_command "hostalive"
     Default: _None_      Attributes: required



! icinga create-host --cluster "icinga-default" --name "host1" --templates "generic-host" --ignore_on_err --address "" --check_command "hostalive" --vars `{"os":"linux"}`
  "results": [
      "code": 200,
      "status": "Object was created"

Access Control

To use this command, you need access to the following:

Field Value
Action "create"
Service Type "icinga"
Service Instance cluster
Object Type "host"
Object ID

Please see Access Control for details.