Query the alert event list

2023-08-15 11:21:17  Updated

Description

You can call this operation to query the alert event list.

Call description

Prerequisite

You have the alert read permissions.

Request path

GET /api/v2/alarm/alarms

Request parameters

Parameter Type Required Example Description
page Integer No 1 The number of the page to return. Pages start from page 1. Default value: 1.
size Integer No 10 The number of entries to return on each page. Maximum value: 200.
appType String No OB The application type or the source of the alert. Valid values: * OB * OCP * OMS * OBProxy * Backup
alarmType String No obagent_dead The alert type. For more information, see the OCP documentation.
scope String No ObCluster The alert scope. Valid values: * ObCluster * ObTenant * AppCluster * Service * Host
level Integer No 1 The alert level. Valid values: 1, 2, 3, 4, 5, corresponding to Stopped, Critical, Warning, Caution, and Reminder.
obClusterGroup String No foo The OceanBase cluster group. This parameter is valid when appType is OB.
obCluster String No foo The OceanBase cluster. This parameter is valid when appType is OB.
obTenant String No foo The OceanBase tenant. This parameter is valid when appType is OB.
hostName String No host1 The name of the host.
hostIp String No 192.168.1.1 The host IP address.
appCluster String No cluster1 The application cluster. This parameter is valid when appType is not OB.
serviceName String No foo The name of the service. An application can have multiple services.
status String No Active The alert status. Valid values: * Active * Inactive * Silenced * Inhibited
activeAtStart Datetime No 2020-11-11T11:12:13.127+08:00 The start time when the alert is triggered.
activeAtEnd Datetime No 2020-11-11T17:11:13.127+08:00 The end time when the alert is triggered.
isSubscribedByMe Boolean No true Whether the alert is subscribed by the current user.
keyword String No hello The keyword used to match the alert.
category String No OB The alert category. Valid values: * OB * APP

Response parameters

  • Basic data structure

    Parameter Type Description
    data Object The request data.
    ├─ contents Array The list of alert events. The subsequent table describes its data structure.
    ├─ page Object The page information.
    ├─ totalElements Integer The total number of entries.
    ├─ totalPage Integer The total number of pages.
    ├─ number Integer The page number of the returned page.
    ├─ size Integer The number of entries returned per page.
    successful Boolean Indicates whether the request was successful.
    timestamp Datetime The timestamp when the server completed the request.
    duration Integer The time taken by the server to process the request, in milliseconds.
    status Integer An HTTP status code.
    traceId String The trace ID of the request. This trace ID is used for troubleshooting.
    server String The address of the server that responded to the request.
  • Data structure of an alert event

    Parameter Type Description
    id Integer The ID of the alert event.
    appType String The application type. Valid values: * OB * OCP * OMS * OBProxy * Backup
    alarmType String The alert type.
    scope String The alert scope. Valid values: * ObCluster * ObTenant * AppCluster * Service * Host
    level Integer The alert level. Valid values: 1, 2, 3, 4, 5, corresponding to Stopped, Critical, Warning, Caution, and Reminder.
    status String The alert status. Valid values: * Active * Inactive * Silenced * Inhibited
    target String The target object of the alert event. This parameter is generated based on the target template of the alert rule.
    summary String The overview of the alert event. This parameter is generated based on the overview template of the alert rule.
    description String The details of the alert event. This parameter is generated based on the details template of the alert rule.
    activeAt Datetime The time when the alert event was generated.
    resolvedAt Datetime The time when the alert event was cleared.
    updatedAt Datetime The time when the alert event was updated.
    labels Object The label and value of the alert event.

Examples

Sample request

GET /api/v2/alarm/alarms

Sample response

{
    "duration": 5,
    "server": "100.88.121.149",
    "status": 200,
    "successful": true,
    "timestamp": "2020-12-03T09:46:18.041+08:00",
    "traceId": "e94370b9b40c46c1",
    "data": {
        "contents": [
            {
                "activeAt": "2020-12-03T01:44:04Z",
                "alarmType": "no_enough_exporter",
                "appType": "OCP",
                "description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                "gmtCreate": "2020-12-03T01:44:04Z",
                "gmtModified": "2020-12-03T01:45:04.048708Z",
                "id": 1000160,
                "labels": {
                    "alarm_name": "Insufficient exporter processes",
                    "app_type": "OCP",
                    "svr_ip": "100.88.121.148",
                    "alarm_description_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "host_services": "OB_CLUSTER,OB_PROXY",
                    "alarm_level": "Stopped",
                    "alarm_description_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_name_3": "Insufficient exporter processes",
                    "alarm_description_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough, deployed services OB_CLUSTER,OB_PROXY,  expected exporter count 6, actual exporter count 5",
                    "alarm_name_2": "exporter number not enough",
                    "expected_exporter_count": "6",
                    "alarm_name_1": "Insufficient exporter processes",
                    "alarm_type": "no_enough_exporter",
                    "alarm_summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_status": "Active",
                    "alarm_scope": "Host",
                    "alarm_active_at": "2020-12-03T01:44:04Z",
                    "alarm_target": "service=OCP:svr_ip=100.88.121.148",
                    "app": "OCP",
                    "actual_exporter_count": "5",
                    "alarm_is_build_in_rule": "true",
                    "host_ip": "100.88.121.148",
                    "alarm_duration": "0",
                    "service": "OCP",
                    "alarm_description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_updated_at": "2020-12-03T01:45:04Z",
                    "alarm_summary_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough",
                    "alarm_summary_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_summary_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_evaluation_interval": "60"
                },
                "level": 1,
                "scope": "Host",
                "status": "Active",
                "summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                "target": "service=OCP:svr_ip=100.88.121.148",
                "updatedAt": "2020-12-03T01:45:04Z"
            },
            {
                "activeAt": "2020-12-03T00:52:03Z",
                "alarmType": "no_enough_exporter",
                "appType": "OCP",
                "description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                "gmtCreate": "2020-12-03T00:52:03Z",
                "gmtModified": "2020-12-03T01:10:12.300278Z",
                "id": 1000159,
                "labels": {
                    "alarm_name": "Insufficient exporter processes",
                    "app_type": "OCP",
                    "svr_ip": "100.88.121.148",
                    "alarm_description_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "host_services": "OB_CLUSTER,OB_PROXY",
                    "alarm_level": "Stopped",
                    "alarm_description_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_name_3": "Insufficient exporter processes",
                    "alarm_description_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough, deployed services OB_CLUSTER,OB_PROXY,  expected exporter count 6, actual exporter count 5",
                    "alarm_name_2": "exporter number not enough",
                    "expected_exporter_count": "6",
                    "alarm_name_1": "Insufficient exporter processes",
                    "alarm_type": "no_enough_exporter",
                    "alarm_summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_status": "Inactive",
                    "alarm_scope": "Host",
                    "alarm_active_at": "2020-12-03T00:52:03Z",
                    "alarm_target": "service=OCP:svr_ip=100.88.121.148",
                    "alarm_resolved_at": "2020-12-03T01:10:12Z",
                    "app": "OCP",
                    "actual_exporter_count": "5",
                    "alarm_is_build_in_rule": "true",
                    "host_ip": "100.88.121.148",
                    "alarm_duration": "0",
                    "service": "OCP",
                    "alarm_description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_updated_at": "2020-12-03T01:05:03Z",
                    "alarm_summary_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough",
                    "alarm_summary_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_summary_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_evaluation_interval": "60"
                },
                "level": 1,
                "resolvedAt": "2020-12-03T01:10:12Z",
                "scope": "Host",
                "status": "Inactive",
                "summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                "target": "service=OCP:svr_ip=100.88.121.148",
                "updatedAt": "2020-12-03T01:05:03Z"
            },
            {
                "activeAt": "2020-12-03T00:22:04Z",
                "alarmType": "no_enough_exporter",
                "appType": "OCP",
                "description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                "gmtCreate": "2020-12-03T00:22:03Z",
                "gmtModified": "2020-12-03T00:30:12.304777Z",
                "id": 1000158,
                "labels": {
                    "alarm_name": "Insufficient exporter processes",
                    "app_type": "OCP",
                    "svr_ip": "100.88.121.148",
                    "alarm_description_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "host_services": "OB_CLUSTER,OB_PROXY",
                    "alarm_level": "Stopped",
                    "alarm_description_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_name_3": "Insufficient exporter processes",
                    "alarm_description_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough, deployed services OB_CLUSTER,OB_PROXY,  expected exporter count 6, actual exporter count 5",
                    "alarm_name_2": "exporter number not enough",
                    "expected_exporter_count": "6",
                    "alarm_name_1": "Insufficient exporter processes",
                    "alarm_type": "no_enough_exporter",
                    "alarm_summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_status": "Inactive",
                    "alarm_scope": "Host",
                    "alarm_active_at": "2020-12-03T00:22:04Z",
                    "alarm_target": "service=OCP:svr_ip=100.88.121.148",
                    "alarm_resolved_at": "2020-12-03T00:30:12Z",
                    "app": "OCP",
                    "actual_exporter_count": "5",
                    "alarm_is_build_in_rule": "true",
                    "host_ip": "100.88.121.148",
                    "alarm_duration": "0",
                    "service": "OCP",
                    "alarm_description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_updated_at": "2020-12-03T00:25:03Z",
                    "alarm_summary_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough",
                    "alarm_summary_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_summary_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_evaluation_interval": "60"
                },
                "level": 1,
                "resolvedAt": "2020-12-03T00:30:12Z",
                "scope": "Host",
                "status": "Inactive",
                "summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                "target": "service=OCP:svr_ip=100.88.121.148",
                "updatedAt": "2020-12-03T00:25:03Z"
            },
            {
                "activeAt": "2020-12-02T23:25:04Z",
                "alarmType": "no_enough_exporter",
                "appType": "OCP",
                "description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                "gmtCreate": "2020-12-02T23:25:04Z",
                "gmtModified": "2020-12-02T23:50:12.300299Z",
                "id": 1000157,
                "labels": {
                    "alarm_name": "Insufficient exporter processes",
                    "app_type": "OCP",
                    "svr_ip": "100.88.121.148",
                    "alarm_description_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "host_services": "OB_CLUSTER,OB_PROXY",
                    "alarm_level": "Stopped",
                    "alarm_description_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_name_3": "Insufficient exporter processes",
                    "alarm_description_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough, deployed services OB_CLUSTER,OB_PROXY,  expected exporter count 6, actual exporter count 5",
                    "alarm_name_2": "exporter number not enough",
                    "expected_exporter_count": "6",
                    "alarm_name_1": "Insufficient exporter processes",
                    "alarm_type": "no_enough_exporter",
                    "alarm_summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_status": "Inactive",
                    "alarm_scope": "Host",
                    "alarm_active_at": "2020-12-02T23:25:04Z",
                    "alarm_target": "service=OCP:svr_ip=100.88.121.148",
                    "alarm_resolved_at": "2020-12-02T23:50:12Z",
                    "app": "OCP",
                    "actual_exporter_count": "5",
                    "alarm_is_build_in_rule": "true",
                    "host_ip": "100.88.121.148",
                    "alarm_duration": "0",
                    "service": "OCP",
                    "alarm_description": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient. The deployed services OB_CLUSTER and OB_PROXY require 6 exporter processes, but the actual number of exporter processes is only 5.",
                    "alarm_updated_at": "2020-12-02T23:45:02Z",
                    "alarm_summary_2": "service=OCP:svr_ip=100.88.121.148 exporter number not enough",
                    "alarm_summary_1": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_summary_3": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                    "alarm_evaluation_interval": "60"
                },
                "level": 1,
                "resolvedAt": "2020-12-02T23:50:12Z",
                "scope": "Host",
                "status": "Inactive",
                "summary": "service=OCP:svr_ip=100.88.121.148. The number of exporter processes is insufficient.",
                "target": "service=OCP:svr_ip=100.88.121.148",
                "updatedAt": "2020-12-02T23:45:02Z"
            }
        ],
        "page": {
            "number": 1,
            "size": 3,
            "totalElements": 10,
            "totalPages": 4
        }
    }
}

Contact Us