VMware Monitor (Read-Only)
Disclaimer: This is a community-maintained open-source project and is not affiliated with, endorsed by, or sponsored by VMware, Inc. or Broadcom Inc. "VMware" and "vSphere" are trademarks of Broadcom. Source code is publicly auditable at github.com/zw008/VMware-Monitor under the MIT license.
Read-only VMware vCenter/ESXi monitoring — 8 MCP tools, zero destructive code.
Code-level safety: This skill contains NO power, create, delete, snapshot, or modify operations. Not disabled — they don't exist in the codebase.
Companion skills: vmware-aiops (VM lifecycle), vmware-storage (iSCSI/vSAN), vmware-vks (Tanzu Kubernetes), vmware-nsx (NSX networking), vmware-nsx-security (DFW/firewall), vmware-aria (metrics/alerts/capacity), vmware-avi (AVI/ALB/AKO).
| vmware-pilot (workflow orchestration) | vmware-policy (audit/policy)
What This Skill Does
| Category | Capabilities |
|---|
| Inventory | List VMs, ESXi hosts, datastores, clusters |
| Health |
Active alarms, recent events (filter by severity/time) |
|
VM Details | CPU, memory, disks, NICs, snapshots, guest OS, IP |
|
Scanning | Scheduled alarm/log scanning with Slack/Discord webhooks |
Quick Install
CODEBLOCK0
When to Use This Skill
- - List or search VMs, hosts, datastores, clusters
- Check active alarms or recent events
- Get detailed info about a specific VM
- Set up scheduled monitoring with webhook alerts
- Any read-only VMware query where safety is paramount
Alarm/Event Output: suggested_actions Field
INLINECODE1 and get_events results include a suggested_actions list.
Each item is a ready-to-use hint pointing to the correct companion skill and tool:
CODEBLOCK1
AI agents (especially smaller local models) can read these hints directly to determine which skill and tool to call next, without needing to reason about skill routing themselves.
Use companion skills for:
- - Power on/off, deploy, clone, migrate --> INLINECODE4
- iSCSI, vSAN, datastore management --> INLINECODE5
- Tanzu Kubernetes clusters --> INLINECODE6
- Load balancing, AVI/ALB, AKO, Ingress --> INLINECODE7
Related Skills — Skill Routing
| User Intent | Recommended Skill |
|---|
| Read-only vSphere monitoring, zero risk | vmware-monitor ← this skill |
| Storage: iSCSI, vSAN, datastores |
vmware-storage |
| VM lifecycle, deployment, guest ops |
vmware-aiops |
| Tanzu Kubernetes (vSphere 8.x+) |
vmware-vks |
| NSX networking: segments, gateways, NAT |
vmware-nsx |
| NSX security: DFW rules, security groups |
vmware-nsx-security |
| Aria Ops: metrics, alerts, capacity planning |
vmware-aria |
| Multi-step workflows with approval |
vmware-pilot |
| Load balancer, AVI, ALB, AKO, Ingress |
vmware-avi (
uv tool install vmware-avi) |
| Audit log query |
vmware-policy (
vmware-audit CLI) |
Common Workflows
Daily Health Check
- 1. Check alarms --> INLINECODE10
- Review recent events --> INLINECODE11
- List hosts -->
vmware-monitor inventory hosts --> check connection state and memory usage - If connection fails --> run
vmware-monitor doctor to diagnose config/network issues
Investigate a Specific VM
- 1. Find the VM --> INLINECODE14
- Get details --> INLINECODE15
- Check related events --> INLINECODE16
- If VM not found --> verify VM name with
vmware-monitor inventory vms --limit 100 or check target with INLINECODE18
Set Up Continuous Monitoring
- 1. Configure webhook in INLINECODE19
- Start daemon --> INLINECODE20
- Daemon scans every 15 min, sends alerts to Slack/Discord
Usage Mode
| Scenario | Recommended | Why |
|---|
| Local/small models (Ollama, Qwen) | CLI | ~2K tokens vs ~8K for MCP |
| Cloud models (Claude, GPT-4o) |
Either | MCP gives structured JSON I/O |
| Automated pipelines |
MCP | Type-safe parameters, structured output |
MCP Tools (8 — all read-only)
| Tool | Description |
|---|
| INLINECODE21 | List VMs with filtering (power state, sort, limit) |
| INLINECODE22 |
ESXi hosts with CPU, memory, version, uptime |
|
list_all_datastores | Datastores with capacity, free space, type |
|
list_all_clusters | Clusters with host count, DRS/HA status |
|
get_alarms | All active/triggered alarms — includes
suggested_actions remediation hints |
|
get_events | Recent events filtered by severity and time — includes
suggested_actions hints |
|
vm_info | Detailed VM info (CPU, memory, disks, NICs, snapshots) |
All tools are read-only. No tool can modify, create, or delete any resource.
CLI Quick Reference
CODEBLOCK2
Full CLI reference: see INLINECODE30
Troubleshooting
Alarms returns empty but vCenter shows alarms
The
get_alarms tool queries triggered alarms at the root folder level. Some alarms are entity-specific — try checking events instead:
get_events --hours 1 --severity info.
"Connection refused" error
- 1. Run
vmware-monitor doctor to diagnose - Verify target hostname/IP and port (443) in config.yaml
- For self-signed certs: set INLINECODE34
Events returns too many results
Use severity filter:
--severity warning (default) filters out info-level events. Use
--hours 4 to narrow time range.
VM info shows "guest_os: unknown"
VMware Tools not installed or not running in the guest. Install/start VMware Tools for guest OS detection, IP address, and guest family info.
Doctor passes but commands fail with timeout
vCenter may be under heavy load. Try targeting a specific ESXi host directly instead of vCenter, or increase connection timeout in config.yaml.
Setup
CODEBLOCK3
All tools are automatically audited via vmware-policy. Audit logs: INLINECODE37
Full setup guide, security details, and AI platform compatibility: see INLINECODE38
Audit & Safety
All operations are automatically audited via vmware-policy (@vmware_tool decorator):
- - Every tool call logged to
~/.vmware/audit.db (SQLite, framework-agnostic) - Policy rules enforced via
~/.vmware/rules.yaml (deny rules, maintenance windows, risk levels) - Risk classification: each tool tagged as low/medium/high/critical
- View recent operations: INLINECODE42
- View denied operations: INLINECODE43
vmware-policy is automatically installed as a dependency — no manual setup needed.
License
MIT — github.com/zw008/VMware-Monitor
VMware Monitor (只读)
免责声明:这是一个由社区维护的开源项目,与 VMware, Inc. 或 Broadcom Inc. 没有任何关联、背书或赞助关系。VMware 和 vSphere 是 Broadcom 的商标。源代码在 MIT 许可下于 github.com/zw008/VMware-Monitor 公开可审计。
只读的 VMware vCenter/ESXi 监控 — 8 个 MCP 工具,零破坏性代码。
代码级安全:此技能不包含任何电源、创建、删除、快照或修改操作。不是被禁用——它们在代码库中根本不存在。
配套技能:vmware-aiops(VM 生命周期)、vmware-storage(iSCSI/vSAN)、vmware-vks(Tanzu Kubernetes)、vmware-nsx(NSX 网络)、vmware-nsx-security(DFW/防火墙)、vmware-aria(指标/告警/容量)、vmware-avi(AVI/ALB/AKO)。
| vmware-pilot(工作流编排)| vmware-policy(审计/策略)
此技能的功能
| 类别 | 能力 |
|---|
| 清单 | 列出虚拟机、ESXi 主机、数据存储、集群 |
| 健康状态 |
活跃告警、近期事件(按严重程度/时间筛选)|
|
虚拟机详情 | CPU、内存、磁盘、网卡、快照、客户机操作系统、IP |
|
扫描 | 定时告警/日志扫描,支持 Slack/Discord Webhook |
快速安装
bash
uv tool install vmware-monitor
vmware-monitor doctor
何时使用此技能
- - 列出或搜索虚拟机、主机、数据存储、集群
- 检查活跃告警或近期事件
- 获取特定虚拟机的详细信息
- 设置带 Webhook 告警的定时监控
- 任何需要确保安全性的只读 VMware 查询
告警/事件输出:suggested_actions 字段
getalarms 和 getevents 的结果包含一个 suggested_actions 列表。
每个项目都是一个可直接使用的提示,指向正确的配套技能和工具:
json
{
alarm_name: VM CPU Ready High,
entity_name: prod-db-01,
suggested_actions: [
vmware-aiops: acknowledgevcenteralarm(entityname=prod-db-01, alarmname=VM CPU Ready High),
vmware-aiops: resetvcenteralarm(entityname=prod-db-01, alarmname=VM CPU Ready High)
]
}
AI 代理(尤其是较小的本地模型)可以直接读取这些提示,以确定下一步要调用哪个技能和工具,无需自行推理技能路由。
使用配套技能处理:
- - 开机/关机、部署、克隆、迁移 --> vmware-aiops
- iSCSI、vSAN、数据存储管理 --> vmware-storage
- Tanzu Kubernetes 集群 --> vmware-vks
- 负载均衡、AVI/ALB、AKO、Ingress --> vmware-avi
相关技能 — 技能路由
| 用户意图 | 推荐技能 |
|---|
| 只读 vSphere 监控,零风险 | vmware-monitor ← 此技能 |
| 存储:iSCSI、vSAN、数据存储 |
vmware-storage |
| VM 生命周期、部署、客户机操作 |
vmware-aiops |
| Tanzu Kubernetes(vSphere 8.x+)|
vmware-vks |
| NSX 网络:分段、网关、NAT |
vmware-nsx |
| NSX 安全:DFW 规则、安全组 |
vmware-nsx-security |
| Aria Ops:指标、告警、容量规划 |
vmware-aria |
| 带审批的多步骤工作流 |
vmware-pilot |
| 负载均衡器、AVI、ALB、AKO、Ingress |
vmware-avi(uv tool install vmware-avi)|
| 审计日志查询 |
vmware-policy(vmware-audit CLI)|
常见工作流
每日健康检查
- 1. 检查告警 --> vmware-monitor health alarms --target prod-vcenter
- 查看近期事件 --> vmware-monitor health events --hours 24 --severity warning
- 列出主机 --> vmware-monitor inventory hosts --> 检查连接状态和内存使用情况
- 如果连接失败 --> 运行 vmware-monitor doctor 诊断配置/网络问题
调查特定虚拟机
- 1. 查找虚拟机 --> vmware-monitor inventory vms --power-state poweredOff
- 获取详情 --> vmware-monitor vm info problem-vm
- 检查相关事件 --> vmware-monitor health events --hours 48
- 如果未找到虚拟机 --> 使用 vmware-monitor inventory vms --limit 100 验证虚拟机名称,或使用 --target 检查目标
设置持续监控
- 1. 在 ~/.vmware-monitor/config.yaml 中配置 Webhook
- 启动守护进程 --> vmware-monitor daemon start
- 守护进程每 15 分钟扫描一次,向 Slack/Discord 发送告警
使用模式
| 场景 | 推荐 | 原因 |
|---|
| 本地/小型模型(Ollama、Qwen) | CLI | 约 2K tokens vs MCP 约 8K |
| 云端模型(Claude、GPT-4o) |
两者皆可 | MCP 提供结构化 JSON I/O |
| 自动化流水线 |
MCP | 类型安全参数、结构化输出 |
MCP 工具(8 个 — 全部只读)
| 工具 | 描述 |
|---|
| listvirtualmachines | 列出虚拟机,支持筛选(电源状态、排序、限制) |
| listesxihosts |
ESXi 主机,含 CPU、内存、版本、运行时间 |
| list
alldatastores | 数据存储,含容量、可用空间、类型 |
| list
allclusters | 集群,含主机数量、DRS/HA 状态 |
| get
alarms | 所有活跃/触发的告警 — 包含 suggestedactions 修复提示 |
| get
events | 按严重程度和时间筛选的近期事件 — 包含 suggestedactions 提示 |
| vm_info | 详细的虚拟机信息(CPU、内存、磁盘、网卡、快照)|
所有工具均为只读。没有工具可以修改、创建或删除任何资源。
CLI 快速参考
bash
vmware-monitor inventory vms [--target ] [--limit 20] [--power-state poweredOn]
vmware-monitor inventory hosts [--target ]
vmware-monitor inventory datastores [--target ]
vmware-monitor inventory clusters [--target ]
vmware-monitor health alarms [--target ]
vmware-monitor health events [--hours 24] [--severity warning]
vmware-monitor vm info [--target ]
vmware-monitor scan now [--target ]
vmware-monitor daemon start|stop|status
vmware-monitor doctor [--skip-auth]
完整 CLI 参考:参见 references/cli-reference.md
故障排除
告警返回空结果但 vCenter 显示有告警
get
alarms 工具查询根文件夹级别的触发告警。某些告警是特定于实体的 — 尝试改用事件检查:getevents --hours 1 --severity info。
连接被拒绝错误
- 1. 运行 vmware-monitor doctor 进行诊断
- 验证 config.yaml 中的目标主机名/IP 和端口(443)
- 对于自签名证书:设置 disableS