Information

Centreon Gorgone and his "gorgoned" daemon is a lightweight, distributed, modular tasks handler.

It provides a set of actions like:

  • Execute commands
  • Send files/directories,
  • Schedule cron-like tasks,
  • Push or execute tasks through SSH.

The daemon can be installed on Centreon environments like Centreon Central, Remote and Poller servers.

It uses ZeroMQ library.

Authentication

Basic Authentication

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Internal

Internal events.

Get nodes connection status

Get the connection status of all nodes managed by the Gorgone daemon.

Authorizations:

Responses

200

OK

401

Unauthorized

403

Forbidden

get/internal/constatus

Local Gorgone instance

{protocol}://{server}:{port}/api/internal/constatus

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/internal/constatus

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "action": "constatus",
  • "message": "ok",
  • "data":
    {
    }
}

Get runtime informations and statistics

Get informations and statistics about loaded modules, available endpoints and number of events computed at runtime.

Authorizations:

Responses

200

OK

401

Unauthorized

403

Forbidden

get/internal/information

Local Gorgone instance

{protocol}://{server}:{port}/api/internal/information

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/internal/information

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "action": "information",
  • "message": "ok",
  • "data":
    {
    }
}

Get public key thumbprint

Get the thumbprint of the public key of the Gorgone daemon.

Authorizations:

Responses

200

OK

401

Unauthorized

403

Forbidden

get/internal/thumbprint

Local Gorgone instance

{protocol}://{server}:{port}/api/internal/thumbprint

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/internal/thumbprint

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "action": "getthumbprint",
  • "message": "ok",
  • "data":
    {
    }
}

Set logger severity level

Set the logger severity level for all modules.

Authorizations:
Request Body schema: application/json
severity
string
Enum: "info" "error" "debug"

Severity level to be defined for all loaded modules

Responses

204

OK

401

Unauthorized

403

Forbidden

post/internal/logger

Local Gorgone instance

{protocol}://{server}:{port}/api/internal/logger

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/internal/logger

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "severity": "info"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "http_error_401",
  • "message": "unauthorized"
}

Logs

Logs management.

Retrieve event's logs

Retrieve the event's logs based on event's token.

Authorizations:
path Parameters
token
required
string
Example: 1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165

Token of the event

query Parameters
code
integer
Enum: 0 1 2
Example: code=2

Only retrieve logs with defined code

limit
integer >= 1
Example: limit=1

Only retrieve the last x logs

ctime
integer <int64>
Example: ctime=1577726040

Only retrieve logs with a creation time equal or superior to a timestamp

etime
integer <int64>
Example: etime=1577726040

Only retrieve logs of an event time superior to a timestamp

Responses

200

OK

401

Unauthorized

403

Forbidden

get/log/{token}

Local Gorgone instance

{protocol}://{server}:{port}/api/log/{token}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/log/{token}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "message": "Logs found",
  • "token": "03008486ba50b52e529ff5828d1432e5578dd18bb530c145b133dc902c8cfa6b8aac4d58fffb0c5ed44b943d2acbfb7cd1b18c55fcebce62e51999db460112c7",
  • "data":
    [
    ]
}

Cron

Module aiming to reproduce a cron-like scheduler that can send events to other Gorgone modules.

List definitions

List all cron definitions.

Authorizations:

Responses

200

OK

401

Unauthorized

403

Forbidden

get/core/cron/definitions

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Add definitions

Add one or multiple cron definitions to runtime.

Authorizations:
Request Body schema: application/json
Array
timespec
required
string

Cron-like time specification

id
required
string

Unique identifier of the cron definition

action
required
string

Action/event to call at job execution

parameters
required
object

Parameters needed by the called action/event

keep_token
boolean

Boolean to define whether or not the ID of the definition will be used as token for the command

Responses

200

OK

401

Unauthorized

403

Forbidden

post/core/cron/definitions

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Get a definition

List cron definition identified by id.

Authorizations:
path Parameters
definition_id
required
string
Example: broker_stats

ID of the definition

Responses

200

OK

401

Unauthorized

403

Forbidden

get/core/cron/definitions/{definition_id}

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions/{definition_id}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions/{definition_id}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Update a definition

Update a cron definition.

Authorizations:
path Parameters
definition_id
required
string
Example: broker_stats

ID of the definition

Request Body schema: application/json
timespec
required
string

Cron-like time specification

id
required
string

Unique identifier of the cron definition

action
required
string

Action/event to call at job execution

parameters
required
object

Parameters needed by the called action/event

keep_token
boolean

Boolean to define whether or not the ID of the definition will be used as token for the command

Responses

200

OK

401

Unauthorized

403

Forbidden

patch/core/cron/definitions/{definition_id}

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions/{definition_id}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions/{definition_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "timespec": "string",
  • "id": "string",
  • "action": "string",
  • "parameters": { },
  • "keep_token": true
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Delete a definition

Delete a cron definition.

Authorizations:
path Parameters
definition_id
required
string
Example: broker_stats

ID of the definition

Responses

200

OK

401

Unauthorized

403

Forbidden

delete/core/cron/definitions/{definition_id}

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions/{definition_id}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions/{definition_id}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Get a definition status

Get a definition execution status.

Authorizations:
path Parameters
definition_id
required
string
Example: broker_stats

ID of the definition

Responses

200

OK

401

Unauthorized

403

Forbidden

get/core/cron/definitions/{definition_id}/status

Local Gorgone instance

{protocol}://{server}:{port}/api/core/cron/definitions/{definition_id}/status

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/cron/definitions/{definition_id}/status

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Action

Module aiming to execute actions on the server running the Gorgone daemon or remotly using SSH.

Execute one or several command lines

Execute a command or a set of commands on server running Gorgone.

Authorizations:
Request Body schema: application/json
Array
command
required
string

Command to execute

timeout
integer
Default: 30

Time in seconds before a command is considered timed out

continue_on_error
boolean
Default: false

Behaviour in case of execution issue

Responses

200

OK

401

Unauthorized

403

Forbidden

post/core/action/command

Local Gorgone instance

{protocol}://{server}:{port}/api/core/action/command

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/core/action/command

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Engine

Module aiming to provide a bridge to communicate with Centreon Engine daemon.

Send one or several external commands

Send an external command or a set of external commands to a running Centreon Engine instance using command file pipe. This method needs the commands to be preformatted as Nagios external commands format.

Authorizations:
Request Body schema: application/json
command_file
string

Path to the Centreon Engine command file pipe

command
Array of strings

Responses

200

OK

401

Unauthorized

403

Forbidden

post/centreon/engine/command

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/engine/command

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/engine/command

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "command_file": "/var/lib/centreon-engine/rw/centengine.cmd",
  • "command":
    [
    ]
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Statistics

Module aiming to deal with statistics collection of Centreon Engine and Broker.

Launch Broker statistics collection

Launch Broker statistics collection and store the result on disk.

Authorizations:

Responses

200

OK

401

Unauthorized

403

Forbidden

get/centreon/statistics/broker

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/statistics/broker

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/statistics/broker

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Launch Broker statistics collection of a specific monitoring server

Launch Broker statistics collection and store the result on disk.

Authorizations:
path Parameters
monitoring_server_id
required
integer
Example: 2

ID of the monitoring server

Responses

200

OK

401

Unauthorized

403

Forbidden

get/centreon/statistics/broker/{monitoring_server_id}

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/statistics/broker/{monitoring_server_id}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/statistics/broker/{monitoring_server_id}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Autodiscovery

Module aiming to extend Centreon Autodiscovery server functionalities.

Add a host discovery job

Add one Centreon Autodiscovery job to discover hosts.

Authorizations:
Request Body schema: application/json
job_id
required
integer

ID of the Host Discovery job

target
required
integer

Identifier of the target on which to execute the command

command_line
required
string

Command line to execute to perform the discovery

timeout
integer

Time in seconds before the command is considered timed out

execution
required
object

Execution mode of this job ('0': execute immediately, '1': schedule with cron)

post_execution
object

Post-execution settings

Responses

200

OK

401

Unauthorized

403

Forbidden

post/centreon/autodiscovery/hosts

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/autodiscovery/hosts

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/autodiscovery/hosts

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "job_id": 14,
  • "target": 2,
  • "command_line": "perl /usr/lib/centreon/plugins/centreon_generic_snmp.pl --plugin=os::linux::local::plugin --mode=discovery-snmp --subnet='10.1.2.3/24' --snmp-port='161' --snmp-version='2c' --snmp-community='public'",
  • "timeout": 300,
  • "execution":
    {
    },
  • "post_execution":
    {
    }
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Launch a host discovery job

Launch a host discovery job identified by id (even if in cron mode).

Authorizations:
path Parameters
job_id
required
integer
Example: 2

ID of the job

Responses

200

OK

401

Unauthorized

403

Forbidden

get/centreon/autodiscovery/hosts/{job_id}/schedule

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/autodiscovery/hosts/{job_id}/schedule

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/autodiscovery/hosts/{job_id}/schedule

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}

Delete a host discovery job

Delete one Centreon Autodiscovery scheduled job.

Authorizations:
path Parameters
token
required
string
Example: discovery_14_6b7d1bb8

Token of the scheduled job

Responses

200

OK

401

Unauthorized

403

Forbidden

delete/centreon/autodiscovery/hosts/{token}

Local Gorgone instance

{protocol}://{server}:{port}/api/centreon/autodiscovery/hosts/{token}

Remote Gorgone instance

{protocol}://{server}:{port}/api/nodes/{id}/centreon/autodiscovery/hosts/{token}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "token": "1d48a26a0fc37c1d8658222378044007d9c12311ba49b214de633739be05353415eee946f41b43babb6cb2a083a45c0d6359f361874af39a45b07542de8e2165"
}