host.create

    This method allows to create new hosts.

    This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See for more information.

    Parameters

    (object/array) Hosts to create.

    Additionally to the , the method accepts the following parameters.

    Examples

    Creating a host

    Create a host called “Linux server” with an IP interface and tags, add it to a group, link a template to it and set the MAC addresses in the host inventory.

    :

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "hostids": [
    5. },
    6. "id": 1
    7. }

    Creating a host with SNMP interface

    Create a host called “SNMP host” with an SNMPv3 interface with details.

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "hostids": [
    5. "10658"
    6. ]
    7. },
    8. }

    Creating a host with PSK encryption

    Create a host called “PSK host” with PSK encryption configured. Note that the host has to be pre-configured to use PSK.

    :

    Response:

    1. "jsonrpc": "2.0",
    2. "result": {
    3. "hostids": [
    4. "10590"
    5. ]
    6. },
    7. "id": 1
    8. }

    Source