---
title: "查询告警事件 | OceanBase 文档中心"
description: "查询告警事件 功能说明 查询指定告警事件的详细信息。 调用说明 接口约束 调用者需要告警功能的读权限。 请求路径 GET /api/v2/alarm/alarms/{id} 请求参数 名称 类型 示例值 描述 id Integer 1023 告警事件的 ID 返回结果 基础数据结构 参数 类型 说明 data Obj…"
---
切换语言

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

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

# 查询告警事件

更新时间：2023-08-10 11:45:58

## **功能说明**

查询指定告警事件的详细信息。

## **调用说明**

**接口约束**

调用者需要告警功能的读权限。

**请求路径**

`GET /api/v2/alarm/alarms/{id}`

**请求参数**

| 名称 | 类型 | 示例值 | 描述 |
| --- | --- | --- | --- |
| id | Integer | 1023 | 告警事件的 ID |

**返回结果**

- 基础数据结构

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

  | 参数 | 类型 | 说明 |
  | --- | --- | --- |
  | id | Integer | 告警事件的 ID |
  | appType | String | 应用类型，取值范围： * OB * OCP * OMS * OBProxy * Backup |
  | alarmType | String | 告警类型 |
  | scope | String | 告警范围，取值范围： * ObCluster * ObTenant * AppCluster * Service * Host |
  | level | Integer | 告警等级 [1~5] ，分别对应：Down、Critical、Alert、Caution、Info。 |
  | status | String | 告警状态，取值范围： * Active * Inactive * Silenced * Inhibited |
  | target | String | 告警事件的目标对象，基于告警规则的目标模板生成。 |
  | summary | String | 告警事件的概述，基于告警规则的概述模板生成。 |
  | description | String | 告警事件的详情，基于告警规则的详情模板生成。 |
  | activeAt | Datetime | 告警事件的生成时间 |
  | resolvedAt | Datetime | 告警事件的消除时间 |
  | updatedAt | Datetime | 告警事件的更新时间 |
  | labels | Object | 告警事件的标签和值 |

## **示例**

**请求示例**

查看告警事件 ID 为 1000159 的详细信息。

```code
GET /api/v2/alarm/alarms/100159

```

**返回示例**

```code
{
    "data": {
        "activeAt": "2020-12-03T00:52:03Z",
        "alarmType": "no_enough_exporter",
        "appType": "OCP",
        "description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够, 部署服务 OB_CLUSTER,OB_PROXY，预期exporter数量 6，实际exporter数量 5",
        "gmtCreate": "2020-12-03T00:52:03Z",
        "gmtModified": "2020-12-03T01:10:12.300278Z",
        "id": 1000159,
        "labels": {
            "alarm_name": "exporter進程數量不夠",
            "app_type": "OCP",
            "svr_ip": "xxx.xxx.xxx.xxx",
            "alarm_description_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter進程數量不夠",
            "host_services": "OB_CLUSTER,OB_PROXY",
            "alarm_level": "停服",
            "alarm_description_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够, 部署服务 OB_CLUSTER,OB_PROXY，预期exporter数量 6，实际exporter数量 5",
            "alarm_name_3": "exporter進程數量不夠",
            "alarm_description_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx 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": "exporter进程数量不够",
            "alarm_type": "no_enough_exporter",
            "alarm_summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够",
            "alarm_status": "Inactive",
            "alarm_scope": "主机",
            "alarm_active_at": "2020-12-03T00:52:03Z",
            "alarm_target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
            "alarm_resolved_at": "2020-12-03T01:10:12Z",
            "app": "OCP",
            "actual_exporter_count": "5",
            "alarm_is_build_in_rule": "true",
            "host_ip": "xxx.xxx.xxx.xxx",
            "alarm_duration": "0",
            "service": "OCP",
            "alarm_description": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够, 部署服务 OB_CLUSTER,OB_PROXY，预期exporter数量 6，实际exporter数量 5",
            "alarm_updated_at": "2020-12-03T01:05:03Z",
            "alarm_summary_2": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter number not enough",
            "alarm_summary_1": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够",
            "alarm_summary_3": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter進程數量不夠",
            "alarm_evaluation_interval": "60"
        },
        "level": 1,
        "resolvedAt": "2020-12-03T01:10:12Z",
        "scope": "Host",
        "status": "Inactive",
        "summary": "service=OCP:svr_ip=xxx.xxx.xxx.xxx exporter进程数量不够",
        "target": "service=OCP:svr_ip=xxx.xxx.xxx.xxx",
        "updatedAt": "2020-12-03T01:05:03Z"
    },
    "duration": 8,
    "server": "a83ad33525",
    "status": 200,
    "successful": true,
    "timestamp": "2020-12-03T09:48:54.98+08:00",
    "traceId": "2ad80c3bac1b4ad7"
}

```

 上一篇 下一篇 ![有帮助](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) 咨询热线
