Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

URL: https://123.123.123.123/hosts/add.json

Methode: POST

Response: JSON


HostRequired for addingRequired for editingDescriptionInheritedTypeExample

id
(Warnung)The host ID
integer123

name(Warnung)(Warnung)The name of the host
string"default host"

address(Warnung)(Warnung)The IP address of the host
string"123.123.123.123"

satellite_id

ID of the satellite if this host is to be monitored by a satellite
integer123

own_contacts

null = contacts from template |

1 = contacts deviating from template


null | integernull or 1

own_contactgroups

null = contact groups from template |

1 = contact groups that differ from the template


null | integernull or 1

own_customvariables

null = no custom variables |

1 = use custom variables


null | integernull or 1

container_id(Warnung)(Warnung)ID of the container in which the host is created (1 = /root)
integer123

shared_container

IDs of the containers in which the host is to be shared
array[ 1, 2, 3, ....]

hosttemplate_id(Warnung)(Warnung)ID of the host template from which the host inherits its settings
integer123

description

A description of the host
(Haken)
string"host description"

Hostgroup(Warnung)(Warnung)IDs of the host groups in which the host is to be located(Haken)array[ 1, 2, 3, ....]

Parenthost
(Warnung)The ID of the parent host
null | integernull oder 123

notes

Notes regarding the host(Haken)string"Lorem ipsum dolor sit amet"

host_url

The URL of the host(Haken)string"http://hosturl.com"

priority

Priority of the host (not yet implemented)(Haken)null | integernull or 1

tags

Host specific label(Haken)string"Lorem ipsum dolor sit amet"

notify_period_id

ID of the notification_period(Haken)integer123

notification_interval(Warnung)
The notification interval (in seconds)(Haken)integer123

notify_on_recovery

Notification upon recovery(Haken)null | integernull or 1

notify_on_down

Notification when down(Haken)null | integernull or 1

notify_on_unreachable

Notification when unreachable(Haken)null | integernull or 1

notify_on_flapping

Notification when flapping(Haken)null | integernull or 1

notify_on_downtime

Notification during downtime(Haken)null | integernull or 1

active_checks_enabled

The host is actively checked(Haken)null | integernull or 1

Contact

The contact IDs(Haken)array[ 1, 2, 3, ....]

Contactgroup

IDs for the contact groups(Haken)array[ 1, 2, 3, ....]

command_id(Warnung)
The command ID(Haken)null | integernull or 123

check_period_id

The check_period ID(Haken)null | integernull or 123

max_check_attempts

The maximum number of checks to be carried out
null | integernull or count

check_interval(Warnung)
Check interval (in seconds)(Haken)null | integernull or 123

retry_interval(Warnung)
Retry interval (in seconds)(Haken)null | integernull or 123

flap_detection_enabled

If flap_detection is to be activated(Haken)null | integernull or 1

flap_detection_on_up

flap_detection when status is "up""(Haken)null | integernull or 1

flap_detection_on_down

flap_detection when status is "down"(Haken)null | integernull or 1

flap_detection_on_unreachable

flap_detection when status is "unreachable"(Haken)null | integernull or 1

JSON to create a host via REST API
{
    "Host" : {
        "name":"api host",
        "address":"127.0.0.1",
        "satellite_id":0,
        "own_contacts":null,
        "own_contactgroups":null,
        "own_customvariables":null,
        "container_id":1,
        "shared_container":[],
        "hosttemplate_id":1,
        "description":"",
        "Hostgroup":[],
        "Parenthost":null,
        "notes":"",
        "host_url":"",
        "priority":null,
        "tags":"",
        "notify_period_id":1,
        "notification_interval":null,
        "notify_on_recovery":null,
        "notify_on_down":null,
        "notify_on_unreachable":null,
        "notify_on_flapping":null,
        "notify_on_downtime":null,
        "active_checks_enabled":null,
        "Contact":[],
        "Contactgroup":[],
        "command_id":$COMMAND_ID,
        "check_period_id":null,
        "max_check_attempts":null,
        "check_interval":null,
        "retry_interval":null,
        "flap_detection_enabled":null,
        "flap_detection_on_up":null,
        "flap_detection_on_down":null,
        "flap_detection_on_unreachable":null
    },
    "Hostcommandargumentvalue":[],
    "Customvariable":{
		"1":{
			"name":"NAME1",
			"value":"$VALUE",
			"objecttype_id":256
		}
	}
}
Minimal JSON
{
    "Host" : {
        "name":"api host",
        "address":"127.0.0.1",
        "container_id":1,
        "hosttemplate_id":1,
        "notification_interval":null,
        "check_interval":null,
        "Hostgroup":[],
        "retry_interval":null
    }
}
Response on successful API call
{
  "id": "123"
}
Example error code
{
  "error": {
    "container_id": [
      "Invalid container."
    ]
  }
}
  • Keine Stichwörter