Skip to content

icinga modify-host

modifies a host object

Description

modifies a host object

Synopsis

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

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      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

address - (string)

     The host’s IPv4 address. Available as command runtime macro $address$ if set.
     Example: --address "192.168.1.1"
     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: optional

Examples

Input:

! icinga modify-host --name "host1" --check_command "hostalive"  --vars `{"os":"unix"}`
Output:
{
  "results": [
    {
      "code": 200,
      "name": "host1",
      "status": "Attributes updated.",
      "type": "Host"
    }
  ]
}

Access Control

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

Field Value
Action "update"
Service Type "icinga"
Service Instance cluster
Namespace
Object Type "host"
Object ID name

Please see Access Control for details.