> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/automate-protect-and-extend/zh/ji-cheng-yu-api/external-monitoring.md).

# 外部监控

## 概述

本页面介绍如何将 VergeOS 与外部监控和可观测性平台集成。VergeOS 采用 API 优先设计，并通过三种受支持的方式公开平台运行状况、性能和硬件传感器数据。

{% hint style="warning" %}
**不支持 SNMP**

VergeOS 不包含 SNMP 代理、MIB 或陷阱机制。SNMP 设计于 20 世纪 80 年代末，用于管理路由器、交换机和打印机等硬件网络设备，而非现代软件定义平台。VergeOS 采用 API 优先设计：SNMP 代理可公开的每项指标和资源，均已通过 REST API 和 Prometheus Exporter 提供；它们通过标准 HTTP 提供更丰富的结构化数据。这与更广泛的行业转变一致：Microsoft 已在 Windows Server 2012 中弃用 SNMP 服务，云原生和虚拟机监控程序平台则已标准化采用 Prometheus 暴露格式。如果您的旧版监控工具需要 SNMP，请参阅 [SNMP 优先工具](#snmp-first-tools) 下文了解可用的解决方法。
{% endhint %}

### 支持的监控方式

| 方式                                                                | 适用场景          | 适用对象             |
| ----------------------------------------------------------------- | ------------- | ---------------- |
| [Prometheus Exporter (ioMetrics)](#prometheus-exporter-iometrics) | vSAN、集群和节点指标  | 大多数环境推荐的起点       |
| [REST API](#rest-api)                                             | 自定义采集器，轮询任意资源 | 特定工具集成、脚本化检查     |
| [IPMI](#ipmi)                                                     | 每节点硬件运行状况和传感器 | VergeOS 外部的硬件级监控 |

***

## Prometheus Exporter (ioMetrics)

该 **VergeOS Prometheus Exporter (ioMetrics)** 是平台级指标的推荐方式。它从 VergeOS 收集 vSAN 层级、集群和节点级指标，并以标准 Prometheus 格式公开，可供 Prometheus、Grafana、VictoriaMetrics 或任何兼容 Prometheus 的系统抓取。

### 为何这是推荐方式

* **第一方** — 由 verge-io 组织维护
* **基于标准** — 任何兼容 Prometheus 的监控工具均可使用该输出

请参阅 [Prometheus Exporter (ioMetrics)](/automate-protect-and-extend/zh/ji-cheng-yu-api/prometheus-exporter.md) 页面，了解产品内概述、公开的指标以及开源项目链接。

***

## REST API

VergeOS REST API 公开了 UI 可以读取的每个资源，因此它适合用于自定义采集器、脚本化运行状况检查，或与不支持 Prometheus 的工具集成。

### 身份验证

外部监控采集器会长期运行，应使用 API 密钥而非会话令牌进行身份验证。API 密钥按用户创建，可限定 IP 范围并设置过期时间。请参阅 [API 密钥](/automate-protect-and-extend/zh/gong-xiang-guan-li-jie-mian/api-keys.md) 了解设置，以及参阅 [API 指南](/knowledge-base/zh/automation-api/verge-api-guide.md) 了解完整的受支持身份验证方法列表。

### Swagger 文档

完整且与版本准确对应的 API 参考资料可在 VergeOS 内部获取：

1. 单击 **用户图标** ，位于 VergeOS UI 的右上角。
2. 选择 **系统**.
3. 选择 **API 文档**.

Swagger 页面列出每个表和操作，并提供可直接针对系统运行的示例。

{% hint style="success" %}
**从何开始**

有关 HTTP 约定、筛选、排序和示例请求的背景信息，请参阅知识库中的 [API 指南](/knowledge-base/zh/automation-api/verge-api-guide.md) 。
{% endhint %}

### 何时使用 REST API 进行监控

* 监控工具支持 HTTP 轮询，但不支持 Prometheus
* Prometheus Exporter 未公开某个特定指标或资源
* 需要自定义采集器以与内部可观测性平台集成

***

## IPMI

对于 **每节点硬件运行状况和传感器数据** — 温度、风扇转速、电压、功耗、硬件错误 — VergeOS 会直接公开节点的 IPMI 接口。

1. 导航至 **基础架构 > 节点** ，可从顶部菜单进入。
2. 双击所需节点以打开节点仪表板。
3. 在 **IPMI** 子菜单下，单击 **连接** 以在新标签页中打开 IPMI Web 界面，或单击 **测试** 以验证从 VergeOS 发起的连接。

{% hint style="info" %}
**仅限硬件**

IPMI 公开主机节点的 **物理硬件** 状态，而非 VergeOS 应用层指标。大多数监控平台已经包含 IPMI 采集器，可直接轮询节点 BMC，并与上述 Prometheus Exporter 和 REST API 方式并行使用。
{% endhint %}

有关配置已存储的 IPMI 凭据和测试连接，请参阅 [IPMI](/run-the-platform/zh/xi-tong-guan-li/ipmi.md) 页面。

***

## SNMP 优先工具

诸如 **SolarWinds**, **LogicMonitor**, **PRTG**和 **Nagios** 等工具通常配置为通过 SNMP 监控基础架构。VergeOS 没有针对这些工具的现成集成，因为没有可供它们连接的 SNMP 代理。

{% hint style="success" %}
**首先检查原生 Prometheus 支持**

这些平台中的部分现在可原生接收 Prometheus 指标 — **LogicMonitor** （OpenMetrics 数据源）和 **SolarWinds Observability** （Prometheus 集成）。如果您的平台属于其中之一，请将其指向 [Prometheus Exporter](#prometheus-exporter-iometrics) ，并跳过本节其余内容。以下两个选项适用于不支持 Prometheus 的工具，其中包括本地部署的 **SolarWinds Platform / SAM**, **PRTG**和 **Nagios**.
{% endhint %}

### 选项 1 — 自定义 REST 采集器

大多数企业监控平台允许使用自定义 HTTP/REST 采集器：

| 平台           | 机制                    |
| ------------ | --------------------- |
| SolarWinds   | API Poller (SAM)      |
| LogicMonitor | 脚本化数据源（Groovy / HTTP） |
| PRTG         | HTTP XML/REST 自定义传感器  |
| Nagios       | `check_http` / 自定义插件  |

将采集器指向 VergeOS REST API，按照 [API 指南](/knowledge-base/zh/automation-api/verge-api-guide.md)进行身份验证，并解析 JSON 响应。这是开销最低的方式 — 无需维护中间进程，且采集器直接与事实来源通信。

### 选项 2 — Prometheus 到 SNMP 桥接器

如果监控工具仅支持 SNMP 且无法使用自定义采集器，社区常见模式是运行 [Prometheus Exporter](#prometheus-exporter-iometrics) ，并在其前面部署 Prometheus 到 SNMP 桥接器。该桥接器会将 Prometheus 指标重新公开为 SNMP OID，供 SNMP 轮询器抓取。

{% hint style="warning" %}
**不受 Verge 支持**

Prometheus 到 SNMP 桥接器是社区项目，并非由 Verge 构建、测试或支持。我们不推荐特定桥接器 — 选择取决于需要重新公开的 Prometheus 指标子集，以及下游工具如何使用 SNMP。请将此方式视为权宜之计，而非长期集成方案。
{% endhint %}

***

## 选择方式

| 场景                                                 | 推荐方式                                                                                                                    |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| 新的监控部署，尚未绑定现有工具                                    | [Prometheus Exporter](#prometheus-exporter-iometrics) + Grafana                                                         |
| 现有 Prometheus / Grafana / VictoriaMetrics 技术栈      | [Prometheus Exporter](#prometheus-exporter-iometrics)                                                                   |
| 轮询 HTTP 但不支持 Prometheus 的监控工具                      | [REST API](#rest-api) 自定义采集器                                                                                            |
| 硬件运行状况（温度、风扇、电源）                                   | [IPMI](#ipmi)                                                                                                           |
| SolarWinds / LogicMonitor / PRTG / Nagios（SNMP 优先） | [自定义 REST 采集器](#option-1-custom-rest-collector) 优先， [Prometheus 到 SNMP 桥接器](#option-2-prometheus-to-snmp-bridge) 作为备用方案 |

## 后续步骤

* [Prometheus Exporter (ioMetrics)](/automate-protect-and-extend/zh/ji-cheng-yu-api/prometheus-exporter.md) — 产品内概述和开源项目链接
* [API 指南](/knowledge-base/zh/automation-api/verge-api-guide.md) — 身份验证、HTTP 约定和示例请求
* [IPMI](/run-the-platform/zh/xi-tong-guan-li/ipmi.md) — 测试连接、管理凭据以及访问 IPMI Web 界面

## 文档和资源

| 资源                                                                 | 说明                            |
| ------------------------------------------------------------------ | ----------------------------- |
| [vergeos-exporter](https://github.com/verge-io/vergeos-exporter)   | 用于 VergeOS 的开源 Prometheus 导出器 |
| [Prometheus 文档](https://prometheus.io/docs/introduction/overview/) | Prometheus 上游文档               |
| [Grafana 文档](https://grafana.com/docs/)                            | 基于 Prometheus 指标构建仪表板         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verge.io/automate-protect-and-extend/zh/ji-cheng-yu-api/external-monitoring.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
