Skip to content

icinga create-service

Creates a new service object


Creates a new service object


icinga create-service
    [--site <site>]
    [--cluster <cluster>]
    --name <name>
    [--templates <templates>]
    --host_name <host_name>
    [--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 service object. Must be unique on a per-host basis
     Example: --name "service1"
     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-service"
     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

host_name - (string)

     The host this service belongs to. There must be a Host object with that name.
     Example: --host_name "host1"
     Default: _None_      Attributes: required

groups - (string)

     A list of service groups this service belongs to
     Example: --groups "group1"
     Default: _None_      Attributes: optional

vars - (string)

     A dictionary containing custom variables that are specific to this service.
     Example: --vars "{"snmp_community":"public", "snmp_oid":"DISMAN-EVENT-MIB::sysUpTimeInstance"}"
     Default: _None_      Attributes: optional

check_command - (string)

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



! icinga create-service --name "service1" --host_name "host1" --check_command "snmp" --vars `{"snmp_community":"public", "snmp_oid":"DISMAN-EVENT-MIB::sysUpTimeInstance"}`
  "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 "service"
Object ID

Please see Access Control for details.