---
title: "获取当前告警 - 云平台 OCP V4.3.0 | OceanBase 文档中心"
description: 获取当前告警 功能说明 该接口用于获取当前告警。 调用说明 接口约束 调用者需要通过 OCP 应用服务鉴权。 请求路径 GET /api/v2/alarm/alarms/actived 请求参数 body： 参数 类型 必选 示例值 描述 appType String 否 OceanBase 应用类别（告警来源），取…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lJTmRZ61jSUAAAAAAAAAAAAADiGDAQ/original) 云平台 OCPV 4.3.0

# 获取当前告警

更新时间：2026-04-14 11:55:54

[编辑](https://github.com/oceanbase/ocp-doc/edit/V4.3.0/zh-CN/1900.reference-guide/200.api-reference/1000.alert/200.fetch-actived-alarms.md)  

## 功能说明

该接口用于获取当前告警。

## 调用说明

### 接口约束

调用者需要通过 OCP 应用服务鉴权。

### 请求路径

`GET /api/v2/alarm/alarms/actived`

### 请求参数

**body：**

| 参数 | 类型 | 必选 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| appType | String | 否 | OceanBase | 应用类别（告警来源），取值范围：   - OceanBase - OCP - OMS - OBProxy - Binlog - Log OBLB - OBDNS - ODP |
| scope | String | 否 | Cluster | 告警范围，取值范围：   - Cluster - Tenant - Host - Service - BinlogService - Arbitration - Backup - OceanBaseLog - OBProxyLog - HostLog |
| target | Array | 否 | alarm_template_id=0:ob_cluster=TEST_CLUSTER-12:tenant_name=oracle:trans_hash=10609937150880685421 | 告警目标对象，基于告警规则的目标模板生成。 |
| alarmType | String | 否 | ob_tenant_exists_expired_xa_trans | 告警类型。 |
| level | Array | 否 | 1 | 告警等级 [1~5] ，分别对应：Down、Critical、Alert、Caution、Info |
| alarmGroupIds | integer | 否 | [1,2,3] | 告警分组的 ID 列表，多个 ID 用英文逗号分隔。 |
| status | Array | 否 | Active | 告警状态，取值范围：   - Active - Inactive - Silenced - Inhibited |
| activeAtStart | String | 否 | 2020-11-11T11:12:13.127+08:00 | 告警触发起始时间。 |
| activeAtEnd | String | 否 | 2020-11-11T17:11:13.127+08:00 | 告警触发截止时间。 |
| keyword | String | 否 | hello | 关键字匹配。 |

### 返回结果

**基础数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| data | Object | 请求的数据。 |
| ├─ contents | Array | 告警详情信息，详情参见 **OcpAlarm 数据结构**。 |
| ├─ page | Object | 分页信息，详情参见 **page 数据结构**。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间（毫秒）。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace ID，用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |

**OcpAlarm 数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| gmtCreate | String | 创建时间。 |
| gmtModified | String | 修改时间。 |
| id | Integer | 告警事件 ID。 |
| alarmId | Integer | 告警 ID。 |
| alarmTemplateId | Integer | 告警模板 ID。 |
| appType | String | 应用类型，取值范围：   - OceanBase - OCP - OMS - OBProxy - Binlog - Log OBLB - OBDNS - ODP |
| alarmType | String | 告警类型。 |
| scope | String | 告警范围，取值范围：   - Cluster - Tenant - Host - Service - BinlogService - Arbitration - Backup - OceanBaseLog - OBProxyLog - HostLog |
| level | Integer | 告警等级 [1~5] ，分别对应：Down、Critical、Alert、Caution、Info。 |
| status | String | 告警状态，取值范围：   - Active - Inactive - Silenced - Inhibited |
| target | String | 告警目标对象，基于告警规则的目标模板生成。 |
| alarmTarget | Object | 告警对象信息，详情参见 **AlarmTarget 数据结构**。 |
| obCluster | Object | 集群相关信息，详情参见 **AlarmTarget 数据结构**。 |
| name | String | 告警名。 |
| summary | String | 告警概述，基于告警规则的概述模板生成。 |
| description | String | 告警详情，基于告警规则的详情模板生成。 |
| activeAt | String | 告警生成时间。 |
| resolvedAt | String | 告警消除时间。 |
| updatedAt | String | 告警更新时间。 |
| statusUpdatedAt | String | 告警状态更新时间。 |
| labels | Object | 告警事件的标签和值。 |
| targetLabels | Object | 告警对象的标签和值，如 `svr_ip`、`ob_tenant_id` 等。 |
| metricGroup | Object | 指标分组的数组，详情参见 **MetricGroup 数据结构**。 |
| messagePush | Object | 告警推送详情，详情参见 **MessagePush 数据结构**。 |
| alarmGroups | Array | 告警分组列表。 |
| originalAlarmId | Integer | 原告警 ID。 |
| containSnapshot | Boolean | 是否包含异常快照。 |
| containSelfcure | Boolean | 是否包含自愈。 |
| resolveComment | String | 解决告警的备注信息。 |

**AlarmTarget 数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| appType | String | 应用类型，取值范围：   - OceanBase - OCP - OMS - OBProxy - Binlog - Log OBLB - OBDNS - ODP |
| scope | String | 告警范围，取值范围：   - Cluster - Tenant - Host - Service - BinlogService - Arbitration - Backup - OceanBaseLog - OBProxyLog - HostLog |
| includeTargets | Array | 告警对象（正向选择）。 |
| excludeTargets | Array | 排除告警对象（反向选择）。 |

**MetricGroup 数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | Integer | 指标分组的 ID。 |
| key | String | 指标分组的编码名称。 |
| className | String | 指标分组对应的类名。 |
| name | String | 指标分组的名称，支持国际化。 |
| description | String | 指标分组的说明信息，支持国际化。 |
| metrics | Array | 指标元数据的数组。 |
| dimension | String | 指标分组的维度。 |
| withLabel | Boolean | 是否为带标签的监控数据群组，默认为 `false`。 |
| order | Integer | 排序参数。 |

**MessagePush 数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| configured | Boolean | 是否配置告警推送。 |
| successCount | Integer | 推送消息成功次数。 |
| noSuccessCount | Integer | 推送消息未成功次数。 |

**page 数据结构**

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| totalElements | Integer | 总记录数。 |
| totalPage | Integer | 总页数。 |
| number | Integer | 当前页码。 |
| size | Integer | 当前页包含的记录条数。 |

## 示例

### 请求示例

`GET /api/v2/alarm/alarms/actived`

### 返回示例

```JSON
{
    "data": {
        "contents": [{
            "activeAt": "2025-06-06T07:03:07Z",
            "alarmGroups": ["数据库内核", "性能"],
            "alarmTarget": {
                "appType": "OceanBase",
                "excludeTargets": [],
                "includeTargets": [{
                    "cluster": {
                        "clusterId": 2,
                        "name": "ob4253_A",
                        "obClusterId": 1731295857
                    },
                    "tenants": [{
                        "name": "A_oracle",
                        "obTenantId": 1004,
                        "tenantId": 7
                    }]
                }],
                "scope": "Tenant"
            },
            "alarmTemplateId": 0,
            "alarmType": "ob_tenant_log_stream_degraded",
            "appType": "OceanBase",
            "autoResolved": true,
            "containSelfcure": false,
            "description": "集群：ob4253_A ，租户：A_oracle，告警：OceanBase租户存在已降级的日志流。租户 A_oracle 的日志流发生仲裁降级, 已降级的日志流个数:3。",
            "gmtCreate": "2025-06-06T07:03:06Z",
            "gmtModified": "2025-06-06T07:12:12.916033Z",
            "id": 192,
            "labels": {
                "ob_tenant_id": "1004",
                "__ob_tenant.id": "7",
                "app_type": "OceanBase",
                "alarm_threshold": "0",
                "ob_tenant_log_stream_degraded_count_value_zh_tw": "3",
                "value_zh_tw": "3",
                "alarm_status_native": "Active",
                "ob_cluster_type_shown": "主",
                "alarm_level": "2",
                "obregion": "ob4253_A",
                "app_native": "OB",
                "alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase租 戶存在已降級的日誌流",
                "alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase tenant have degraded log stream",
                "ob_tenant": "A_oracle",
                "alarm_type": "ob_tenant_log_stream_degraded",
                "alarm_status": "Active",
                "alarm_group_zh_tw": "數據庫內核,性能",
                "alarm_scope": "Tenant",
                "ob_cluster": "ob4253_A",
                "alarm_description_zh_tw": "集群：ob4253_A，租戶：A_oracle，警示：OceanBase租戶存在已降級的日誌流。租戶 A_oracle 的日誌流發生仲裁降級, 已降級的 日誌流個數:3。",
                "value_en_us": "3",
                "is_meta_tenant": "0",
                "app": "OB",
                "__ob_cluster.id": "2",
                "contain_selfcure": "0",
                "tenant_name": "A_oracle",
                "alarm_duration": "545",
                "level": "2",
                "related_svr_ips": "xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx",
                "alarm_name_en_us": "OceanBase tenant have degraded log stream",
                "message_type": "Alarm",
                "alarm_status_zh_cn": "告警中",
                "alarm_group_en_us": "dba,performance",
                "ob_tenant_log_stream_degraded_count_value_zh_cn": "3",
                "value_zh_cn": "3",
                "alarm_description_en_us": "OceanBase cluster: ob4253_A, tenant: A_oracle, alert: OceanBase tenant have degraded log stream. The log stream of OceanBase tenant A_oracle exists degraded, the count of degraded log stream:3.",
                "alarm_level_zh_cn": "严重",
                "tenant_role_en_us": "Primary",
                "ob_cluster_type": "PRIMARY",
                "alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase租户存在已降级的日志流",
                "ob_cluster_type_zh_tw": "主",
                "alarm_description": "集群：ob4253_A，租户：A_oracle，告警：OceanBase租户存在已降级的日志流。租户 A_oracle 的日志流发生仲裁降级, 已降级的日志流个数:3。",
                "ob_cluster_type_native": "PRIMARY",
                "app_zh_tw": "OceanBase",
                "metrics": "ob_tenant_log_stream_degraded_count",
                "ocp_ip": "xx.xx.xx.xx",
                "value_shown": "3",
                "tenant_id": "1004",
                "ob_tenant_log_stream_degraded_count_alarm_threshold": "0",
                "alarm_name": "OceanBase租户存 在已降级的日志流",
                "alarm_status_zh_tw": "警示中",
                "vpc_name": "system-default",
                "related_tenant_names": "A_oracle",
                "values": "3",
                "alarm_level_zh_tw": "嚴重",
                "tenant_role": "PRIMARY",
                "alarm_level_native": "2",
                "app_zh_cn": "OceanBase",
                "alarm_level_en_us": "Critical",
                "ob_cluster_type_en_us": "Primary",
                "auto_resolved": "1",
                "alarm_summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase租户存在已降级的日志流",
                "alarm_active_at": "2025-06-06T15:03:06.671+08:00",
                "alarm_target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle",
                "tenant_role_zh_tw": "主",
                "app_en_us": "OceanBase",
                "value": "3",
                "alarm_name_zh_tw": "OceanBase租戶存在已降級的日誌流",
                "ob_cluster_type_zh_cn": "主",
                "ob_tenant_log_stream_degraded_count_value_en_us": "3",
                "related_ob_cluster_name": "ob4253_A",
                "ob_cluster_name": "ob4253_A",
                "alarm_name_zh_cn": "OceanBase租户存在已降级的日志流",
                "alarm_status_en_us": "Active",
                "tenant_role_shown": "主",
                "alarm_template_id": "0",
                "ob_cluster_id": "1731295857",
                "ob_tenant_log_stream_degraded_count_value": "3",
                "related_ob_cluster_id": "1731295857",
                "tenant_role_zh_cn": "主",
                "alarm_description_zh_cn": "集群：ob4253_A，租户：A_oracle，告警：OceanBase租户存在已降级的日志流 。租户 A_oracle 的日志流发生仲裁降级, 已降级的日志流个数:3。",
                "tenant_role_native": "PRIMARY",
                "obzone": "zone2",
                "alarm_updated_at": "2025-06-06T15:03:06.671+08:00",
                "alarm_group_zh_cn": "数据库内核,性能"
            },
            "level": 2,
            "messagePush": {
                "configured": true,
                "noSuccessCount": 0,
                "successCount": 2
            },
            "name": "OceanBase租户存在已降级的日志流",
            "scope": "Tenant",
            "status": "Active",
            "statusUpdatedAt": "2025-06-06T07:03:07Z",
            "summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle OceanBase租户存在已降级的日志流",
            "target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:tenant_name=A_oracle",
            "updatedAt": "2025-06-06T07:12:13Z"
        },
        {
            "activeAt": "2025-06-06T07:01:56Z",
            "alarmGroups": ["数据库内核", "dev", "可用性"],
            "alarmTarget": {
                "appType": "OceanBase",
                "excludeTargets": [],
                "includeTargets": [{
                    "cluster": {
                        "clusterId": 2,
                        "name": "ob4253_A",
                        "obClusterId": 1731295857
                    },
                    "hosts": [{
                        "hostId": 2,
                        "hostIp": "xxx.xxx.xxx.xxx",
                        "id": 2
                    }]
                }],
                "scope": "Host"
            },
            "alarmTemplateId": 0,
            "alarmType": "ob_cannot_connected",
            "appType": "OceanBase",
            "autoResolved": true,
            "containSelfcure": false,
            "description": "集群：ob4253_A，主 机：xxx.xxx.xxx.xxx，告警：OceanBase服务器无法连接。",
            "gmtCreate": "2025-06-06T07:02:26Z",
            "gmtModified": "2025-06-06T07:14:34.327779Z",
            "id": 187,
            "labels": {
                "app_type": "OceanBase",
                "alarm_threshold": "0",
                "svr_ip": "xxx.xxx.xxx.xxx",
                "value_zh_tw": "0",
                "alarm_status_native": "Active",
                "ob_cluster_type_shown": "主",
                "alarm_level": "1",
                "obregion": "ob4253_A",
                "app_native": "OB",
                "alarm_summary_zh_tw": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase伺服器無法連接",
                "alarm_summary_en_us": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase host cannot connected",
                "alarm_type": "ob_cannot_connected",
                "alarm_status": "Active",
                "alarm_group_zh_tw": "數據庫內核,dev,可用性",
                "host": "xxx.xxx.xxx.xxx",
                "alarm_scope": "Host",
                "alarm_scope_native": "Host",
                "ob_cluster": "ob4253_A",
                "alarm_description_zh_tw": "集群：ob4253_A，伺服器：xxx.xxx.xxx.xxx，警示：OceanBase伺服器無法連接。",
                "value_en_us": "0",
                "app": "OB",
                "__ob_cluster.id": "2",
                "contain_selfcure": "0",
                "alarm_duration": "758",
                "level": "1",
                "related_svr_ips": "xxx.xxx.xxx.xxx",
                "alarm_name_en_us": "OceanBase host cannot connected",
                "message_type": "Alarm",
                "alarm_status_zh_cn": "告警中",
                "alarm_scope_zh_tw": "主機",
                "alarm_group_en_us": "dba,dev,availability",
                "value_zh_cn": "0",
                "alarm_description_en_us": "OceanBase cluster: ob4253_A, host: xxx.xxx.xxx.xxx, alert: OceanBase host cannot connected.",
                "__host.id": "2",
                "alarm_scope_zh_cn": "主机",
                "alarm_level_zh_cn": "停服",
                "ob_cluster_type": "PRIMARY",
                "alarm_summary_zh_cn": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase服务器无法连接",
                "ob_cluster_type_zh_tw": "主",
                "alarm_description": "集群：ob4253_A，主机：xxx.xxx.xxx.xxx，告警：OceanBase服务器无法连接。",
                "ob_cluster_type_native": "PRIMARY",
                "app_zh_tw": "OceanBase",
                "metrics": "ob_connectable",
                "ocp_ip": "xx.xx.xx.xx",
                "ob_connectable_value_en_us": "0",
                "value_shown": "0",
                "alarm_name": "OceanBase服务器无法连接",
                "alarm_status_zh_tw": "警示中",
                "vpc_name": "system-default",
                "ob_connectable_alarm_threshold": "0",
                "related_tenant_names": "sys,A_mysql,A_oracle",
                "values": "0",
                "alarm_level_zh_tw": "停服",
                "ob_connectable_value_zh_cn": "0",
                "alarm_level_native": "1",
                "alarm_scope_en_us": "Host",
                "app_zh_cn": "OceanBase",
                "alarm_level_en_us": "Down",
                "ob_cluster_type_en_us": "Primary",
                "auto_resolved": "1",
                "alarm_summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase服务器无法连接",
                "ob_connectable_value_zh_tw": "0",
                "alarm_active_at": "2025-06-06T15:01:55.884+08:00",
                "alarm_target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx",
                "app_en_us": "OceanBase",
                "value": "0",
                "alarm_name_zh_tw": "OceanBase伺服器無法連接",
                "ob_cluster_type_zh_cn": "主",
                "__ob_server.id": "2",
                "host_ip": "xxx.xxx.xxx.xxx",
                "related_ob_cluster_name": "ob4253_A",
                "ob_cluster_name": "ob4253_A",
                "alarm_name_zh_cn": "OceanBase服务器无法连接",
                "alarm_status_en_us": "Active",
                "alarm_template_id": "0",
                "ob_cluster_id": "1731295857",
                "target": "oceanbase",
                "related_ob_cluster_id": "1731295857",
                "alarm_description_zh_cn": "集群：ob4253_A，主机：xxx.xxx.xxx.xxx，告警：OceanBase服务器无法连接。",
                "obzone": "zone1",
                "alarm_updated_at": "2025-06-06T15:01:55.884+08:00",
                "host_name": "175fd3f9e29b",
                "alarm_group_zh_cn": "数据库内核,dev,可用性",
                "ob_connectable_value": "0"
            },
            "level": 1,
            "messagePush": {
                "configured": true,
                "noSuccessCount": 0,
                "successCount": 2
            },
            "name": "OceanBase服务器无法连接",
            "scope": "Host",
            "status": "Active",
            "statusUpdatedAt": "2025-06-06T07:02:26Z",
            "summary": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx OceanBase服务器无法连接",
            "target": "alarm_template_id=0:ob_cluster=ob4253_A-1731295857:host=xxx.xxx.xxx.xxx",
            "updatedAt": "2025-06-06T07:14:34Z"
        }],
        "page": {
            "number": 1,
            "size": 10,
            "totalElements": 6,
            "totalPages": 1
        }
    },
    "duration": 316,
    "server": "21dc8a9b83",
    "status": 200,
    "successful": true,
    "timestamp": "2025-06-06T15:15:14.569+08:00",
    "traceId": "f07227e18398ef0b"
}

```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
