Skip to content
Daniel edited this page Feb 25, 2021 · 3 revisions

openITCOCKPIT API

This documentation descrips the openITCOCKPIT API used by the Agent in Push mode.

Table of contents

POST /agentconnector/register_agent.json

Used to register new Agent and to check authorization state.

Register new Agent

Request: POST /agentconnector/register_agent.json

{
    "agentuuid": "<uuid>",
    "password": "", // Empty for new Agents
    "hostname": "<optional>",
    "ipaddress": "<optional>"
}

Response:

Status: 201 Created
{
    "agentuuid": "<uuid>",
    "password": "32e8d6eefa9c50e07e9296cd0202126a5926dc4dd473400d3..."
}

Check authorization state of existing agents

Request: POST /agentconnector/register_agent.json

Status: 200 OK
{
    "agentuuid": "<uuid>",
    "password": "32e8d6eefa9c50e07e9296cd0202126a5926dc4dd473400d3..."
}

Error states

400 Bad Request
{
    "error": "Field uuid or password is missing in POST data"
}
403 Forbidden
{
    "error": "The given UUID is already registed with a password!"
}
404 Not Found
{
    "error": "No Agent found for given UUID and password"
}
405 Method Not Allowed
{
    "message": "Method Not Allowed",
    "url": "\/agentconnector\/register_agent.json",
    "code": 405
}

POST /agentconnector/submit_checkdata.json

Used to push check result data to openITCOCKPIT Monitoring Server

Push check results

Request: POST /agentconnector/submit_checkdata.json

{
    "agentuuid": "<uuid>",
    "password": "32e8d6eefa9c50e07e9296cd0202126a5926dc4dd473400d3...",
    "checkdata": {
        "agent":        {},
        "cpu":          {},
        "customchecks": {},
        "disk_io":      {},
        "disks":        {},
        ...
    }
}

Response:

Status: 200 OK
{
    "received_checks": 10
}

Error states

400 Bad Request
{
    "error": "Invalid credentials or host not found"
}
405 Method Not Allowed
{
    "message": "Method Not Allowed",
    "url": "\/agentconnector\/submit_checkdata.json",
    "code": 405
}