From e5ff5f747cd76c9f2550d830c3241bab880652d7 Mon Sep 17 00:00:00 2001 From: loiclau Date: Tue, 10 Dec 2019 17:13:24 +0100 Subject: [PATCH 01/23] fix(js): fix check type of broker connections count (#8185) --- www/include/common/javascript/centreon/brokerConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/include/common/javascript/centreon/brokerConfig.js b/www/include/common/javascript/centreon/brokerConfig.js index bb877a8c11f..32a19d0a02b 100644 --- a/www/include/common/javascript/centreon/brokerConfig.js +++ b/www/include/common/javascript/centreon/brokerConfig.js @@ -161,7 +161,7 @@ var countConnections = { var target = entry[1] + entry[2] + '[' + argument.target + ']'; var entryValue = document.getElementsByName(target)[1].value.replace(",", "."); - if (entryValue == '' || typeof entryValue == "string" || entryValue < 1) { + if (entryValue == '' || isNaN(entryValue) || entryValue < 1) { document.getElementsByName(target)[1].value = 1; } else { document.getElementsByName(target)[1].value = Math.trunc(entryValue); From 58c967920c07a3f63bf2ee5feef47fd9489da088 Mon Sep 17 00:00:00 2001 From: Laurent Calvet Date: Wed, 11 Dec 2019 09:14:20 +0100 Subject: [PATCH 02/23] fea(api): Added API to find the configuration of pollers (#8186) Added API to find the configuration of pollers --- config/Modules/Centreon.yaml | 10 + doc/API/centreon-api-v2.html | 63 +- doc/API/centreon-api-v2.yaml | 130 ++++ .../MonitoringServerController.php | 77 ++ .../MonitoringServerRepositoryInterface.php | 36 + .../MonitoringServerServiceInterface.php | 36 + .../MonitoringServer/MonitoringServer.php | 699 ++++++++++++++++++ .../MonitoringServerService.php | 50 ++ .../MonitoringServerRepositoryRDB.php | 123 +++ 9 files changed, 1203 insertions(+), 21 deletions(-) create mode 100644 src/Centreon/Application/Controller/Configuration/MonitoringServerController.php create mode 100644 src/Centreon/Domain/MonitoringServer/Interfaces/MonitoringServerRepositoryInterface.php create mode 100644 src/Centreon/Domain/MonitoringServer/Interfaces/MonitoringServerServiceInterface.php create mode 100644 src/Centreon/Domain/MonitoringServer/MonitoringServer.php create mode 100644 src/Centreon/Domain/MonitoringServer/MonitoringServerService.php create mode 100644 src/Centreon/Infrastructure/MonitoringServer/MonitoringServerRepositoryRDB.php diff --git a/config/Modules/Centreon.yaml b/config/Modules/Centreon.yaml index 10e72e5296a..09b4efa20a8 100644 --- a/config/Modules/Centreon.yaml +++ b/config/Modules/Centreon.yaml @@ -57,6 +57,16 @@ services: Centreon\Domain\RequestParameters\Interfaces\RequestParametersInterface: class: Centreon\Domain\RequestParameters\RequestParameters + # Poller configuration + Centreon\Domain\MonitoringServer\Interfaces\MonitoringServerServiceInterface: + class: Centreon\Domain\MonitoringServer\MonitoringServerService + + Centreon\Domain\MonitoringServer\Interfaces\MonitoringServerRepositoryInterface: + class: Centreon\Infrastructure\MonitoringServer\MonitoringServerRepositoryRDB + calls: + - method: setSqlRequestTranslator + arguments: ['@sqlRequestTranslator'] + # Real time monitoring sqlRequestTranslator: class: Centreon\Infrastructure\RequestParameters\SqlRequestParametersTranslator diff --git a/doc/API/centreon-api-v2.html b/doc/API/centreon-api-v2.html index eb230ebd078..bb992253bc2 100644 --- a/doc/API/centreon-api-v2.html +++ b/doc/API/centreon-api-v2.html @@ -308,7 +308,7 @@ -

Information

All dates are in ISO 8601 format

Authentication

There are two modes of authentication:

@@ -356,7 +357,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /acknowledgements/hosts
http://localhost/centreon/api/beta/acknowledgements/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on host

Authorizations:
Request Body schema: application/json

Acknowledgment

+
get /acknowledgements/hosts
http://localhost/centreon/api/beta/acknowledgements/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on host

Authorizations:
Request Body schema: application/json

Acknowledgment

comment
string

Short description of the acknowledgement

host_id
integer <int64>

Unique id of the host

is_notify_contacts
boolean

Indicates whether notification is send to the contacts linked to the host or service

@@ -376,7 +377,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /acknowledgements/services
http://localhost/centreon/api/beta/acknowledgements/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on service

Authorizations:
Request Body schema: application/json

Acknowledgment

+
get /acknowledgements/services
http://localhost/centreon/api/beta/acknowledgements/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on service

Authorizations:
Request Body schema: application/json

Acknowledgment

comment
string

Short description of the acknowledgement

host_id
integer <int64>

Unique id of the host

is_notify_contacts
boolean

Indicates whether notification is send to the contacts linked to the host or service

@@ -398,7 +399,27 @@
post /login
http://localhost/centreon/api/beta/login

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "contact":
    {
    },
  • "security":
    {
    }
}

Logout

Entry point to delete an existing authentication token.

Authorizations:

Responses

200

successful operation

403

Forbidden

-
get /logout
http://localhost/centreon/api/beta/logout

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Downtime

This API allow to:

+
get /logout
http://localhost/centreon/api/beta/logout

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

MonitoringServer

This API allow to:

+
    +
  • Show the monitoring server configurations
  • +
+

List all monitoring server configurations

List all monitoring server configurations

+

The available parameters to search / sort_by are:

+
    +
  • id
  • +
  • name
  • +
  • is_localhost
  • +
  • address
  • +
  • is_activate
  • +
+
Authorizations:
query Parameters
limit
integer (RequestParameters.limit) >= 1
Example: limit=20

Max items per pages

+
page
integer (RequestParameters.page) >= 1
Example: page=1

Number of the page requested

+
sort_by
any

Used to sort the request

+
search
any

Used to search with specifics parameters

+

Responses

200

successful operation

+
403

Forbidden

+
500

Internal Server Error

+
get /configuration/monitoring-servers
http://localhost/centreon/api/beta/configuration/monitoring-servers

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Downtime

This API allow to:

  • Show hosts and services downtimes
  • Add a downtime on host or service
  • @@ -433,7 +454,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host

List all downtimes of one host

+
get /monitoring/hosts/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host

List all downtimes of one host

The available parameters to search / sort_by are:

  • id
  • @@ -459,7 +480,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtimes of one host

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

+
get /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtimes of one host

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

Request Body schema: application/json

Downtime

start_time
string <date-time>

Scheduled start date of the downtime (ISO8601)

end_time
string <date-time>

Scheduled end date of the downtime (ISO8601)

@@ -471,7 +492,7 @@

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
post /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-11-21T09:30:06Z",
  • "end_time": "2019-11-21T09:30:06Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string",
  • "with_services": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all services downtimes

List all downtimes of services

+
post /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string",
  • "with_services": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all services downtimes

List all downtimes of services

The available parameters to search / sort_by are:

  • id
  • @@ -500,7 +521,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/services/downtimes
http://localhost/centreon/api/beta/monitoring/services/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host-related service

List all downtimes of one host-related service

+
get /monitoring/services/downtimes
http://localhost/centreon/api/beta/monitoring/services/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host-related service

List all downtimes of one host-related service

The available parameters to search / sort_by are:

  • id
  • @@ -524,7 +545,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtime of one host-related service

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

+
get /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtime of one host-related service

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

service_id
required
integer <int64>

ID of service linked to the host

Request Body schema: application/json

Downtime

start_time
string <date-time>

Scheduled start date of the downtime (ISO8601)

@@ -536,7 +557,7 @@

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
post /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-11-21T09:30:06Z",
  • "end_time": "2019-11-21T09:30:06Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all downtimes

List all downtimes

+
post /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all downtimes

List all downtimes

The available parameters to search / sort_by are:

  • id
  • @@ -565,15 +586,15 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/downtimes
http://localhost/centreon/api/beta/monitoring/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Display one downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

+
get /monitoring/downtimes
http://localhost/centreon/api/beta/monitoring/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Display one downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "author_id": 0,
  • "host_id": 0,
  • "comment": "string",
  • "duration": 0,
  • "entry_time": "2019-11-21T09:30:07Z",
  • "start_time": "2019-11-21T09:30:07Z",
  • "end_time": "2019-11-21T09:30:07Z",
  • "deletion_time": "2019-11-21T09:30:07Z",
  • "actual_start_time": "2019-11-21T09:30:07Z",
  • "actual_end_time": "2019-11-21T09:30:07Z",
  • "is_started": true,
  • "is_cancelled": true,
  • "is_fixed": true,
  • "service_id": 0
}

Cancel a downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

+
get /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "author_id": 0,
  • "host_id": 0,
  • "comment": "string",
  • "duration": 0,
  • "entry_time": "2019-12-10T12:19:38Z",
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "deletion_time": "2019-12-10T12:19:38Z",
  • "actual_start_time": "2019-12-10T12:19:38Z",
  • "actual_end_time": "2019-12-10T12:19:38Z",
  • "is_started": true,
  • "is_cancelled": true,
  • "is_fixed": true,
  • "service_id": 0
}

Cancel a downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
delete /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Monitoring

Real-time monitoring of the services and hosts

+
delete /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Monitoring

Real-time monitoring of the services and hosts

List all services grouped by host groups

Returns all services grouped by host groups.

The available parameters to search / sort_by are:

    @@ -602,7 +623,7 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hostgroups
http://localhost/centreon/api/beta/monitoring/hostgroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all hosts

Returns all hosts.

+
get /monitoring/hostgroups
http://localhost/centreon/api/beta/monitoring/hostgroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all hosts

Returns all hosts.

The available parameters to search / sort_by are:

  • host.id
  • @@ -626,13 +647,13 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts
http://localhost/centreon/api/beta/monitoring/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find host by ID

Retuns a single host with full details and some details about its services

+
get /monitoring/hosts
http://localhost/centreon/api/beta/monitoring/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find host by ID

Retuns a single host with full details and some details about its services

Authorizations:
path Parameters
hostId
required
integer <int64>

ID of host to return

Responses

200

successful operation

403

Forbidden

404

Host not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "alias": "string",
  • "display_name": "string",
  • "name": "string",
  • "state": 0,
  • "services":
    [
    ],
  • "poller_id": 0,
  • "acknowledged": true,
  • "address_ip": "192.168.0.1",
  • "check_attempt": 0,
  • "checked": true,
  • "execution_time": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-11-21T09:30:07Z",
  • "last_hard_state_change": "2019-11-21T09:30:07Z",
  • "last_state_change": "2019-11-21T09:30:07Z",
  • "last_time_down": "2019-11-21T09:30:07Z",
  • "last_time_unreachable": "2019-11-21T09:30:07Z",
  • "last_time_up": "2019-11-21T09:30:07Z",
  • "last_update": "2019-11-21T09:30:07Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "passive_checks": true,
  • "state_type": 0,
  • "timezone": ":Europe/Paris",
  • "active_checks": true,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "last_hard_state": "2019-11-21T09:30:07Z",
  • "last_notification": "2019-11-21T09:30:07Z",
  • "latency": "string",
  • "next_check": "2019-11-21T09:30:07Z",
  • "next_host_notification": 0,
  • "notification_interval": 0,
  • "notification_number": 0,
  • "notify": true,
  • "notify_on_down": true,
  • "notify_on_downtime": true,
  • "notify_on_flapping": true,
  • "notify_on_recovery": true,
  • "notify_on_unreachable": true
}

Find host-related services

Returns all services associated with a host.

+
get /monitoring/hosts/{hostId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "alias": "string",
  • "display_name": "string",
  • "name": "string",
  • "state": 0,
  • "services":
    [
    ],
  • "poller_id": 0,
  • "acknowledged": true,
  • "address_ip": "192.168.0.1",
  • "check_attempt": 0,
  • "checked": true,
  • "execution_time": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-12-10T12:19:38Z",
  • "last_hard_state_change": "2019-12-10T12:19:38Z",
  • "last_state_change": "2019-12-10T12:19:38Z",
  • "last_time_down": "2019-12-10T12:19:38Z",
  • "last_time_unreachable": "2019-12-10T12:19:38Z",
  • "last_time_up": "2019-12-10T12:19:38Z",
  • "last_update": "2019-12-10T12:19:38Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "passive_checks": true,
  • "state_type": 0,
  • "timezone": ":Europe/Paris",
  • "active_checks": true,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "last_hard_state": "2019-12-10T12:19:38Z",
  • "last_notification": "2019-12-10T12:19:38Z",
  • "latency": "string",
  • "next_check": "2019-12-10T12:19:38Z",
  • "next_host_notification": 0,
  • "notification_interval": 0,
  • "notification_number": 0,
  • "notify": true,
  • "notify_on_down": true,
  • "notify_on_downtime": true,
  • "notify_on_flapping": true,
  • "notify_on_recovery": true,
  • "notify_on_unreachable": true
}

Find host-related services

Returns all services associated with a host.

The available parameters to search / sort_by are:

  • service.id
  • @@ -651,14 +672,14 @@

    Information

403

Forbidden

404

Host not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}/services
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find service by ID related to a host

Retuns a single host with full details

+
get /monitoring/hosts/{hostId}/services
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find service by ID related to a host

Retuns a single host with full details

Authorizations:
path Parameters
hostId
required
integer <int64>

Host Id for which service is associed

serviceId
required
integer <int64>

ID of service to return

Responses

200

successful operation

403

Forbidden

404

Host or service not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}/services/{serviceId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services/{serviceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "description": "string",
  • "display_name": "string",
  • "state": 0,
  • "check_attempt": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-11-21T09:30:07Z",
  • "last_state_change": "2019-11-21T09:30:07Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "state_type": 0,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "command_line": "string",
  • "execution_time": 0,
  • "is_acknowledged": true,
  • "is_active_check": true,
  • "is_checked": true,
  • "last_hard_state_change": "2019-11-21T09:30:07Z",
  • "last_notification": "2019-11-21T09:30:07Z",
  • "last_time_critical": "2019-11-21T09:30:07Z",
  • "last_time_ok": "2019-11-21T09:30:07Z",
  • "last_time_unknown": "2019-11-21T09:30:07Z",
  • "last_time_warning": "2019-11-21T09:30:07Z",
  • "last_update": "2019-11-21T09:30:07Z",
  • "latency": 0,
  • "next_check": "2019-11-21T09:30:07Z",
  • "performance_data": "string",
  • "scheduled_downtime_depth": 0
}

List all services grouped by service groups

Returns all services grouped by service groups.

+
get /monitoring/hosts/{hostId}/services/{serviceId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services/{serviceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "description": "string",
  • "display_name": "string",
  • "state": 0,
  • "check_attempt": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-12-10T12:19:38Z",
  • "last_state_change": "2019-12-10T12:19:38Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "state_type": 0,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "command_line": "string",
  • "execution_time": 0,
  • "is_acknowledged": true,
  • "is_active_check": true,
  • "is_checked": true,
  • "last_hard_state_change": "2019-12-10T12:19:38Z",
  • "last_notification": "2019-12-10T12:19:38Z",
  • "last_time_critical": "2019-12-10T12:19:38Z",
  • "last_time_ok": "2019-12-10T12:19:38Z",
  • "last_time_unknown": "2019-12-10T12:19:38Z",
  • "last_time_warning": "2019-12-10T12:19:38Z",
  • "last_update": "2019-12-10T12:19:38Z",
  • "latency": 0,
  • "next_check": "2019-12-10T12:19:38Z",
  • "performance_data": "string",
  • "scheduled_downtime_depth": 0
}

List all services grouped by service groups

Returns all services grouped by service groups.

The available parameters to search / sort_by are:

  • host.id
  • @@ -687,7 +708,7 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/servicegroups
http://localhost/centreon/api/beta/monitoring/servicegroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all services

Returns all services.

+
get /monitoring/servicegroups
http://localhost/centreon/api/beta/monitoring/servicegroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all services

Returns all services.

The available parameters to search / sort_by are:

  • host.id
  • @@ -711,9 +732,9 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/services
http://localhost/centreon/api/beta/monitoring/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}
+
get /monitoring/services
http://localhost/centreon/api/beta/monitoring/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}