Centreon Web RestAPI for Cloud

Many more endpoints are available but not included in this document yet. Please refer to the OnPrem API page if you are looking for a specific endpoint. Bear in mind that not all endpoints described in the OnPrem API page are available on a cloud platform, in particular those related to the administration of the Centreon platform.

Information

All dates are in ISO 8601 format

Authentication

There are two modes of authentication:

  • By token: after identification with your login credentials
  • By cookie: by reusing a valid session ID

Host

Find all host configurations

Return all host configurations.

The available parameters to search / sort_by are:

  • id
  • name
  • address
  • poller.id
  • poller.name
  • category.id
  • category.name
  • severity.id
  • severity.name
  • group.id
  • group.name
  • is_activated
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Create a host configuration

Create a host configuration

Request Body schema: application/json
required
monitoring_server_id
required
integer

ID of the host's monitoring server

name
required
string

Host name

address
required
string

IP or domain of the host

alias
string

Host alias

snmp_community
string or null

Community of the SNMP agent

snmp_version
string or null
Enum: 1 "2c" 3

Version of the SNMP agent.

The value can be 1, 2c or 3

geo_coords
string or null

Geographic coordinates of the host

timezone_id
integer or null

Timezone ID

severity_id
integer or null

Severity ID

check_timeperiod_id
integer or null

Check command timeperiod ID

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the host check command if it returns any non-OK state

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the host.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this host after a non-UP state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the host.

note
string or null <= 65535 characters

Define an optional note.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more actions to be performed on the host.

icon_id
integer or null

Define the ID of the image that should be associated with this host

is_activated
boolean or null

Indicates whether the host is activated or not

categories
Array of integers

Define the host category IDs that should be associated with this host

groups
Array of integers

Define the host group IDs that should be associated with this host

templates
Array of integers

Define the parent host template IDs that should be associated with this host. The order of the IDs determines the inheritance priority order.

Array of objects

Host macros defined for the host (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "monitoring_server_id": 0,
  • "name": "generic-active-host",
  • "address": "127.0.0.1",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "geo_coords": "48.10,12.5",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1,
  • "is_activated": true,
  • "categories": [
    ],
  • "groups": [
    ],
  • "templates": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "monitoring_server_id": 1,
  • "name": "generic-active-host",
  • "address": "127.0.0.1",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "geo_coords": "48.10,12.5",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1,
  • "is_activated": true,
  • "categories": [
    ],
  • "groups": [
    ],
  • "templates": [
    ],
  • "macros": [
    ]
}

Partially update a host configuration

Partially update a host configuration.

path Parameters
host_id
required
integer >= 1
Example: 1

Host ID

Request Body schema: application/json
required
monitoring_server_id
integer

ID of the host's monitoring server

name
string

Host name

address
string

IP or domain of the host

alias
string

Host alias

snmp_community
string or null

Community of the SNMP agent

snmp_version
string or null
Enum: 1 "2c" 3

Version of the SNMP agent.

The value can be 1, 2c or 3

geo_coords
string or null

Geographic coordinates of the host

timezone_id
integer or null

Timezone ID

severity_id
integer or null

Severity ID

check_timeperiod_id
integer or null

Check command timeperiod ID

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the host check command if it returns any non-OK state

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the host.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this host after a non-UP state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

event_handler_enabled
integer

Indicates whether the event handler is enabled or not

  • 0 - STATUS_DISABLED
  • 1 - STATUS_ENABLED
  • 2 - STATUS_DEFAULT (inheritance of its parent's value. If there is no parent, the values used will be that of Centreon Engine)
event_handler_command_id
integer or null

Event handler command ID

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the host.

note
string or null <= 65535 characters

Define an optional note.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more actions to be performed on the host.

icon_id
integer or null

Define the ID of the image that should be associated with this host

is_activated
boolean or null

Indicates whether the host is activated or not

categories
Array of integers

Define the host category IDs that should be associated with this host

groups
Array of integers

Define the host group IDs that should be associated with this host

templates
Array of integers

Define the parent host template IDs that should be associated with this host. The order of the IDs determines the inheritance priority order.

Array of objects

Host macros defined for the host (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "monitoring_server_id": 0,
  • "name": "generic-active-host",
  • "address": "127.0.0.1",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "geo_coords": "48.10,12.5",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "event_handler_enabled": 0,
  • "event_handler_command_id": 1,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1,
  • "is_activated": true,
  • "categories": [
    ],
  • "groups": [
    ],
  • "templates": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Host group

List all host groups

Return all host group configurations.

The available parameters to search / sort_by are:

  • id
  • name
  • alias
  • is_activated
  • hostcategory.id
  • hostcategory.name
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Add a host group

Add a new host group configuration.

Mandatory body properties are:

  • name
Request Body schema: application/json
required
name
string <= 200 characters

Host group name

alias
string or null <= 200 characters

Host group alias

icon_id
integer or null

Define the image ID that should be associated with this host group

geo_coords
string or null <= 32 characters

Geographical coordinates use by Centreon Map module to position element on map

is_activated
boolean

Indicates whether the host group is activated or not

Responses

Request samples

Content type
application/json
{
  • "name": "MySQL-Servers",
  • "alias": "All MySQL Servers",
  • "icon_id": 1,
  • "geo_coords": "48.51,2.20",
  • "is_activated": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "MySQL-Servers",
  • "alias": "All MySQL Servers",
  • "icon_id": 1,
  • "geo_coords": "48.51,2.20",
  • "is_activated": true
}

Get a host group

Find an existing host group.

path Parameters
hostgroup_id
required
integer <int64>
Example: 5

ID of the host group

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "MySQL-Servers",
  • "alias": "All MySQL Servers",
  • "icon_id": 1,
  • "geo_coords": "48.51,2.20",
  • "is_activated": true
}

Update a host group

Update an existing host group.

path Parameters
hostgroup_id
required
integer <int64>
Example: 5

ID of the host group

Request Body schema: application/json
required
name
string <= 200 characters

Host group name

alias
string or null <= 200 characters

Host group alias

icon_id
integer or null

Define the image ID that should be associated with this host group

geo_coords
string or null <= 32 characters

Geographical coordinates use by Centreon Map module to position element on map

is_activated
boolean

Indicates whether the host group is activated or not

Responses

Request samples

Content type
application/json
{
  • "name": "MySQL-Servers",
  • "alias": "All MySQL Servers",
  • "icon_id": 1,
  • "geo_coords": "48.51,2.20",
  • "is_activated": true
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Host template

Find all host template configurations

Return all host template configurations.

The available parameters to search / sort_by are:

  • id
  • name
  • alias
  • is_locked
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Create a host template configuration

Create a host template configuration

Request Body schema: application/json
required
name
required
string

Host template name

alias
required
string

Host template alias

snmp_community
string or null

Community of the SNMP agent

snmp_version
string or null
Enum: 1 "2c" 3

Version of the SNMP agent.

The value can be 1, 2c or 3

timezone_id
integer or null

Timezone ID

severity_id
integer or null

Severity ID

check_timeperiod_id
integer or null

Check command timeperiod ID

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the host check command if it returns any non-OK state

nornal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the host.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this host after a non-UP state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the host.

note
string or null <= 65535 characters

Define an optional note.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more actions to be performed on the host.

icon_id
integer or null

Define the image ID that should be associated with this host template

categories
Array of integers

Define the host category IDs that should be associated with this host template

templates
Array of integers

Define the parent host templates IDs that should be associated with this host template. The order of the IDs determine the inheritance priority order.

Array of objects

Host macros defined for the host (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "name": "generic-active-host",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "nornal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1,
  • "categories": [
    ],
  • "templates": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "generic-active-host",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1,
  • "is_locked": true,
  • "categories": [
    ],
  • "templates": [
    ],
  • "macros": [
    ]
}

Partially update a host template configuration

Partially update a host template configuration.

path Parameters
host_template_id
required
integer >= 1
Example: 1

Host template ID

Request Body schema: application/json
required
Array of objects

Host macros defined for the host (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

categories
Array of integers

Define the host category IDs that should be associated with this host template

In the case of non-admin users, only categories the user has access to will be accepted and their association to the host template created or deleted.

templates
Array of integers

Define the parent host templates IDs that should be associated with this host template. The order of the IDs determine the inheritance priority order.

name
string

Host template name

alias
string

Host template alias

snmp_community
string or null

Community of the SNMP agent

snmp_version
string or null
Enum: 1 "2c" 3

Version of the SNMP agent.

The value can be 1, 2c or 3

timezone_id
integer or null

Timezone ID

severity_id
integer or null

Severity ID

check_timeperiod_id
integer or null

Check command timeperiod ID

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the host check command if it returns any non-OK state

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the host.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this host after a non-UP state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

event_handler_enabled
integer

Indicates whether the event handler is enabled or not

  • 0 - STATUS_DISABLED
  • 1 - STATUS_ENABLED
  • 2 - STATUS_DEFAULT (inheritance of its parent's value. If there is no parent, the values used will be that of Centreon Engine)
event_handler_command_id
integer or null

Event handler command ID

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the host.

note
string or null <= 65535 characters

Define an optional note.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more actions to be performed on the host.

icon_id
integer or null

Define the image ID that should be associated with this host template

Responses

Request samples

Content type
application/json
{
  • "macros": [
    ],
  • "categories": [
    ],
  • "templates": [
    ],
  • "name": "generic-active-host",
  • "alias": "generic-active-host",
  • "snmp_community": "string",
  • "snmp_version": "2c",
  • "timezone_id": 1,
  • "severity_id": 1,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "event_handler_enabled": 0,
  • "event_handler_command_id": 1,
  • "note_url": "string",
  • "note": "string",
  • "action_url": "string",
  • "icon_id": 1
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Notification

Create a notification

Create a notification

This endpoint is accessible for SaaS platforms only

Request Body schema: application/json
required
name
string

Name of the notification

is_activated
boolean
timeperiod_id
integer

Timeperiod during which the notification is sent

users
Array of integers

Users to whom the notification is sent

contactgroups
Array of integers

Contact Groups to whom the notification is sent

Array of objects (Notification.Message)
Array of objects

Resource configurations that trigger a notification

Responses

Request samples

Content type
application/json
{
  • "name": "Notification-A",
  • "is_activated": true,
  • "timeperiod_id": 0,
  • "users": [
    ],
  • "contactgroups": [
    ],
  • "messages": [
    ],
  • "resources": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

List all notifications

Return all notifications.

The available parameters to search are:

  • name
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Delete multiple notification configurations

Delete multiple notification configurations

This endpoint is accessible for SaaS platforms only

Request Body schema: application/json
required
ids
Array of integers

List of notification IDs to delete

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Get the details of a notification

Get the details of a notification

This endpoint is accessible for SaaS platforms only

path Parameters
notification_id
required
integer >= 1
Example: 1

Notification ID

Responses

Response samples

Content type
application/json
{
  • "code": 403,
  • "message": "You are not authorized to access this resource"
}

Update the details of a notification

Update the details of a notification

This endpoint is accessible for SaaS platforms only

path Parameters
notification_id
required
integer >= 1
Example: 1

Notification ID

Request Body schema: application/json
required
name
string

Name of the notification

is_activated
boolean
timeperiod_id
integer

Timeperiod during which the notification is sent

users
Array of integers

Users to whom the notification is sent

contactgroups
Array of integers

Contact Groups to whom the notification is sent

Array of objects (Notification.Message)
Array of objects

Resource configurations that trigger a notification

Responses

Request samples

Content type
application/json
{
  • "name": "Notification-A",
  • "is_activated": true,
  • "timeperiod_id": 0,
  • "users": [
    ],
  • "contactgroups": [
    ],
  • "messages": [
    ],
  • "resources": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Partial update of a notification definition

Partial update of a notification definition

This endpoint does not handle all notification properties.

The following notification properties are supported in version 23.10 and above:

  • is_activated
path Parameters
notification_id
required
integer >= 1
Example: 1

Notification ID

Request Body schema: application/json
required
is_activated
boolean

Responses

Request samples

Content type
application/json
{
  • "is_activated": true
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Delete a notification

Delete a notification This endpoint is accessible for SaaS platforms only

path Parameters
notification_id
required
integer >= 1
Example: 1

Notification ID

Responses

Response samples

Content type
application/json
{
  • "code": 403,
  • "message": "You are not authorized to access this resource"
}

List all resources and events triggering a notification rule

Return all resources: hosts, services, business activities and configured events triggering a notification rule.

Responses

Response samples

Content type
application/json
{
  • "uid": "547a4e6270e51d63b23b982097aa8386",
  • "result": [
    ]
}

List methods and contacts by notification id

Return a list of notification methods/channels and contacts by notification id.

Responses

Response samples

Content type
application/json
{
  • "notification_id": 2,
  • "channels": {
    }
}

List notifiable contact groups.

List notifiable contact groups for Cloud notification rules configuration.

Responses

Response samples

Content type
application/json
{
  • "result": [
    ]
}

Resource Access Management

Find all resource access rules configured

Return all resource access rules configurations.

The available parameters to search / sort_by are:

  • name
  • description
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Create a resource access rule

Create a resource access rule configuration

Request Body schema: application/json
required
name
required
string

Resource access rule name

required
object
required
object
description
string or null

Short description of the rule

is_enabled
boolean

Indicate the status of the rule enabled/disabled

required
Array of objects or null (DatasetFilter)

Responses

Request samples

Content type
application/json
{
  • "name": "Rule for viewers",
  • "contacts": {
    },
  • "contact_groups": {
    },
  • "description": "Rule dedicated for users with limited rights",
  • "is_enabled": true,
  • "dataset_filters": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "Rule for viewers",
  • "contacts": {
    },
  • "contact_groups": {
    },
  • "description": "Rule dedicated for users with limited rights",
  • "is_enabled": true,
  • "dataset_filters": [
    ]
}

Find a configured resource access rule

Return information about the resource access rule identified by the ID provided

path Parameters
rule_id
required
integer >= 1
Example: 1

Resource access rule ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Rule_for_viewers",
  • "description": "Rule that will be applied to all viewers",
  • "contacts": {
    },
  • "contact_groups": {
    },
  • "is_enabled": true,
  • "dataset_filters": [
    ]
}

Update a resource access rule

Update a resource access rule configuration

path Parameters
rule_id
required
integer >= 1
Example: 1

Resource access rule ID

Request Body schema: application/json
required
name
required
string

Resource access rule name

required
object
required
object
description
string or null

Short description of the rule

is_enabled
boolean

Indicate the status of the rule enabled/disabled

required
Array of objects or null (DatasetFilter)

Responses

Request samples

Content type
application/json
{
  • "name": "Rule for viewers",
  • "contacts": {
    },
  • "contact_groups": {
    },
  • "description": "Rule dedicated for users with limited rights",
  • "is_enabled": true,
  • "dataset_filters": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Delete a resource access rule configuration

Delete a resource access rule configuration.

path Parameters
rule_id
required
integer >= 1
Example: 1

Resource access rule ID

Responses

Response samples

Content type
application/json
{
  • "code": 403,
  • "message": "You are not authorized to access this resource"
}

Update partially a resource access rule

Partial update of resource access rule configuration. The available parameters to update are:

  • name
  • description
  • is_enabled
path Parameters
rule_id
required
integer >= 1
Example: 1

Resource access rule ID

Request Body schema: application/json
required
name
string

Resource access rule name

description
string or null

Short description of the rule

is_enabled
boolean

Indicate the status of the rule enabled/disabled

Responses

Request samples

Content type
application/json
{
  • "name": "Rule for viewers",
  • "description": "Rule dedicated for users with limited rights",
  • "is_enabled": true
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Delete multiple resource access rule configurations

Delete multiple resource access rule configurations

Request Body schema: application/json
required
ids
Array of integers

List of resource access rule IDs to delete

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Service

Add services to a host based on associated host template

Add services to a host based on associated host templates

Responses

Response samples

Content type
application/json
{
  • "services": [
    ]
}

Add a service

Add a service configuration

Request Body schema: application/json
required
name
required
string

Service name.

host_id
required
integer

ID of the host linked to this service.

geo_coords
string or null

Geographic coordinates of the service

service_template_id
integer >= 1

Template ID of the service template.

check_timeperiod_id
integer or null >= 1

Time period ID of the check command.

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the service check command if it returns any non-OK state.

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the service.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this service after a non-OK state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note
string or null <= 65535 characters

Define an optional note.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the service.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to specify actions to be performed on the service.

icon_id
integer or null >= 1

Define the image ID that should be associated with this service.

severity_id
integer or null >= 1

Severity ID.

service_categories
Array of integers
service_groups
Array of integers
Array of objects (macro)

Macros defined for the service (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "name": "generic-service",
  • "host_id": 1,
  • "geo_coords": "48.10,12.5",
  • "service_template_id": null,
  • "check_timeperiod_id": null,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note": "string",
  • "note_url": "string",
  • "action_url": "string",
  • "icon_id": null,
  • "severity_id": 1,
  • "service_categories": [
    ],
  • "service_groups": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "generic-service",
  • "host_id": 1,
  • "geo_coords": "48.10,12.5",
  • "service_template_id": null,
  • "check_timeperiod_id": null,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note": "string",
  • "note_url": "string",
  • "action_url": "string",
  • "icon_id": null,
  • "severity_id": 1,
  • "categories": [
    ],
  • "groups": [
    ],
  • "macros": [
    ]
}

Find all services

Return all service configurations.

The available parameters to search by are:

  • name
  • host.id
  • host.name
  • category.id
  • category.name
  • severity.id
  • severity.name
  • group.id
  • group.name
  • hostgroup.id
  • hostgroup.name
  • hostcategory.id
  • hostcategory.name
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Partial update of a service

Partial update of a service configuration

path Parameters
service_id
required
integer >= 1
Example: 1

Service ID

Request Body schema: application/json
required
name
string

Service name.

host_id
integer

ID of the host linked to this service.

geo_coords
string or null

Geographic coordinates of the service

service_template_id
integer or null >= 1

Template ID of the service template.

check_timeperiod_id
integer or null >= 1

Time period ID of the check command.

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the service check command if it returns any non-OK state.

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the service.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this service after a non-OK state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note
string or null <= 65535 characters

Define an optional note.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the service.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to specify actions to be performed on the service.

icon_id
integer or null >= 1

Define the image ID that should be associated with this service.

severity_id
integer or null >= 1

Severity ID.

is_activated
boolean

Indicates whether the service is activated or not

service_categories
Array of integers
service_groups
Array of integers
Array of objects (macro)

Macros defined for the service (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "name": "generic-service",
  • "host_id": 1,
  • "geo_coords": "48.10,12.5",
  • "service_template_id": null,
  • "check_timeperiod_id": null,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note": "string",
  • "note_url": "string",
  • "action_url": "string",
  • "icon_id": null,
  • "severity_id": 1,
  • "is_activated": true,
  • "service_categories": [
    ],
  • "service_groups": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 403,
  • "message": "You are not authorized to access this resource"
}

Service template

Find all service template

Return all service template configurations.

The available parameters to search / sort_by are:

  • id
  • name
  • alias
  • is_locked
query Parameters
limit
integer >= 1
Default: 10
Example: limit=20

Number of items per page

page
integer >= 1
Default: 1
Example: page=4

Number of the requested page

search
string

Retrieve only data matching the defined search value. A simple search can be done like in the following example search={"host.name":"Central"} A complex search can be done with aggregators and operators. Available search aggregators are:

  • $or
  • $and

Available search operators are:

  • $eq → equal
  • $neq → not equal
  • $lt → less than
  • $le → less or equal than
  • $gt → greater than
  • $ge → greater or equal than
  • $lk → like
  • $nk → not like
  • $in → in
  • $ni → not in
  • $rg → regex

Examples without nested aggregators:

search={
  "$or":[
    {"host.name":{"$eq":"name_1"}},
    {"host.name":{"$eq":"name_2"}}
  ]
}
search={
  "$and":[
    {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
    {"host.name":{"$lk":"fr%"}}
  ]
}

Example with nested aggregators:

search={
  "$or":[
    {
      "$and":[
        {"host.address":{"$rg":"^10\.0\.0\.\d+$"}},
        {"host.name":{"$lk":"fr%"}}
      ]
    },
    {
      "$and":[
        {"host.address":{"$rg":"^192\.168\.0\.\d+$"}},
        {"host.name":{"$lk":"us%"}}
      ]
    }
  ]
}
sort_by
string
Example: sort_by={"host.name":"ASC"}

Sort the resulting data by its properties

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "meta": {
    }
}

Add a service template

Add a service template configuration

Request Body schema: application/json
required
name
required
string

Service template name.

alias
required
string

Service template alias.

service_template_id
integer or null >= 1

Template ID of the service template.

check_command_id
integer or null >= 1

Check command ID.

check_command_args
Array of strings
event_handler_enabled
integer

Indicates whether the event handler is enabled or not

  • 0 - STATUS_DISABLED
  • 1 - STATUS_ENABLED
  • 2 - STATUS_DEFAULT (inheritance of its parent's value. If there is no parent, the values used will be that of Centreon Engine)
event_handler_command_id
integer or null >= 1

Event handler command ID.

check_timeperiod_id
integer or null >= 1

Time period ID of the check command.

max_check_attempts
integer or null

Define the number of times that the monitoring engine will retry the service check command if it returns any non-OK state.

normal_check_interval
integer or null

Define the number of 'time units' between regularly scheduled checks of the service.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer or null

Define the number of "time units" to wait before scheduling a re-check for this service after a non-OK state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note
string or null <= 65535 characters

Define an optional note.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the service.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to specify actions to be performed on the service.

icon_id
integer or null >= 1

Define the image ID that should be associated with this service template.

severity_id
integer or null >= 1

Severity ID.

host_templates
Array of integers
service_categories
Array of integers
Array of objects
Array of objects (macro)

Macros defined for the service (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Responses

Request samples

Content type
application/json
{
  • "name": "generic-service",
  • "alias": "generic-service",
  • "service_template_id": null,
  • "check_command_id": null,
  • "check_command_args": [
    ],
  • "event_handler_enabled": 2,
  • "event_handler_command_id": 1,
  • "check_timeperiod_id": null,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note": "string",
  • "note_url": "string",
  • "action_url": "string",
  • "icon_id": null,
  • "severity_id": 1,
  • "host_templates": [
    ],
  • "service_categories": [
    ],
  • "service_groups": [
    ],
  • "macros": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 400,
  • "message": "Property 'name' not found"
}

Partial update of a service template

Partial update of a service template configuration

path Parameters
service_template_id
required
integer >= 1
Example: 1

Service template ID

Request Body schema: application/json
required
name
string

Service template name.

alias
string

Service template alias.

service_template_id
integer or null >= 1

Template ID of the service template.

check_timeperiod_id
integer >= 1

Time period ID of the check command.

max_check_attempts
integer

Define the number of times that the monitoring engine will retry the service check command if it returns any non-OK state.

normal_check_interval
integer

Define the number of 'time units' between regularly scheduled checks of the service.

With the default time unit of 60s, this number will mean multiples of 1 minute.

retry_check_interval
integer

Define the number of "time units" to wait before scheduling a re-check for this service after a non-OK state was detected.

With the default time unit of 60s, this number will mean multiples of 1 minute.

Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" check interval rate.

note
string or null <= 65535 characters

Define an optional note.

note_url
string or null <= 65535 characters

Define an optional URL that can be used to provide more information about the service.

action_url
string or null <= 65535 characters

Define an optional URL that can be used to specify actions to be performed on the service.

icon_id
integer or null >= 1

Define the image ID that should be associated with this service template.

severity_id
integer or null >= 1

Severity ID.

host_templates
Array of integers
service_categories
Array of integers
Array of objects (macro)

Macros defined for the service (directly or through a template or command inheritance)

If multiple macros are defined with the same name, only the last one will be saved.

Array of objects

Responses

Request samples

Content type
application/json
{
  • "name": "generic-service",
  • "alias": "generic-service",
  • "service_template_id": null,
  • "check_timeperiod_id": 1,
  • "max_check_attempts": 0,
  • "normal_check_interval": 0,
  • "retry_check_interval": 0,
  • "note": "string",
  • "note_url": "string",
  • "action_url": "string",
  • "icon_id": null,
  • "severity_id": 1,
  • "host_templates": [
    ],
  • "service_categories": [
    ],
  • "macros": [
    ],
  • "service_groups": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 403,
  • "message": "You are not authorized to access this resource"
}