← 返回 Skills 市场
freepengyang

Pg Game Monitor

作者 freepengyang · GitHub ↗ · v1.3.0 · MIT-0
cross-platform ⚠ suspicious
56
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install pg-game-monitor
功能描述
Prometheus + Grafana 监控方案,专为**单台物理机部署多个 Java 游戏进程 + 自建 MySQL**的场景设计。Java 进程通过 jstat/jcmd 无侵入采集 JVM 运行时指标(堆内存、新生代、老年代、GC、线程、类内存),MySQL 通过 pymysql 采集(Buffer Po...
安全使用建议
Plain-language checklist before installing: - Do not run the installer as-is on production systems without review. monitor_install.sh runs as root, downloads/extracts binaries, installs packages and enables systemd services. - Verify required environment variables yourself: PUSHGATEWAY and FEISHU_WEBHOOK_URL are required by the scripts even though the registry metadata lists none. Set and protect FEISHU_WEBHOOK_URL (store it with restricted permissions or use Ansible Vault as suggested). - Inspect and, if needed, correct the scripts: the included game_agent.py file appears truncated at the end and contains at least one typo ('loggin'), which could cause runtime errors. Verify the full script before deployment. - Confirm external URLs and versions (Prometheus/Alertmanager/Pushgateway/Grafana) in the installer are valid and acceptable for your environment; the script uses public downloads and a Grafana enterprise RPM. - Prefer deploying into an isolated/test environment first to validate behavior (service startup, resource use, permissions). Check that jstat/jcmd are available and the agent user has permission to call them. - Secure secrets and files: ensure /opt/monitor/feishu/webhook.env and /opt/game_monitor/env.conf have restrictive permissions (600), and consider running Python services in a virtualenv or container to avoid polluting system packages. - Network / firewall: restrict access to Prometheus/Grafana/Pushgateway ports to your admin IPs only. If you want, I can: (1) point out the exact lines in game_agent.py and monitor_install.sh that look buggy or risky, (2) produce a safe checklist or hardened systemd/unit file changes, or (3) extract a minimal subset of files you can run in a sandboxed container for testing.
功能分析
Type: OpenClaw Skill Name: pg-game-monitor Version: 1.3.0 The skill bundle provides a legitimate monitoring solution for Java game servers and MySQL using Prometheus, Grafana, and a custom Python agent. The scripts (game_agent.py, monitor_install.sh) and Ansible playbook (main.yml) perform expected administrative tasks such as process inspection, metric collection via JDK tools (jstat/jcmd), and systemd service management. No evidence of data exfiltration, malicious persistence, or prompt injection was found; all high-risk capabilities (network access, shell execution) are strictly aligned with the stated purpose of monitoring and alerting.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The skill's name/description match the included files (agent, installer, webhook, dashboards). However the registry metadata claims no required environment variables or credentials while SKILL.md and the scripts clearly require at least PUSHGATEWAY and FEISHU_WEBHOOK_URL (and optionally MySQL credentials). That metadata mismatch is a material coherence issue: the skill will not function without secrets/config the registry says it doesn't need.
Instruction Scope
SKILL.md and the included docs instruct the agent/operator to write env files, create systemd units, run the monitor_install.sh installer, and inspect logs (/opt/game_monitor/env.conf, /var/log/game_monitor/). Those actions are within the stated monitoring scope. The troubleshooting steps instruct reading local config/logs and calling local HTTP endpoints (Pushgateway/Prometheus), which is expected. No instructions explicitly exfiltrate secrets to unknown third parties — alert forwarding goes to a user-supplied Feishu webhook. Still, the docs/instructions give the installer broad discretion (systemctl, creating services, writing configs), so it should be run only on hosts you control.
Install Mechanism
There is no formal registry install spec, but the included monitor_install.sh is a full installer that requires root, downloads multiple binaries (GitHub releases and Grafana RPM from dl.grafana.com), extracts them to /opt/monitor, installs system packages and pip packages, writes systemd units, and starts services. Download hosts are well-known but the script runs as root and writes/extracts code and services — moderate risk; review the script before executing. Also some version numbers look odd (e.g., Prometheus '3.5.1' in the script) and should be verified.
Credentials
The SKILL.md and scripts legitimately require configuration env vars: PUSHGATEWAY (required), FEISHU_WEBHOOK_URL (required for webhook), optional MYSQL_USER/PASSWORD, PUSH_INTERVAL, etc. These envs are proportional to the monitoring function. The problem is the registry metadata declares 'none' for required env vars/credentials, which is incorrect. Additional concerns: the installer writes FEISHU_WEBHOOK_URL into /opt/monitor/feishu/webhook.env (monitor_install.sh does not set restrictive file permissions); deploy.md recommends perms 600, but that is not enforced by the script. The Ansible playbook calls pip globally (no virtualenv), which can alter system Python packages.
Persistence & Privilege
The installer creates persistent systemd services (prometheus, alertmanager, pushgateway, grafana-server, feishu) and enables them. This is expected for a monitoring stack, but it requires root and will create long-lived services running on the host. The skill is not set to always:true in the registry. It does not attempt to modify other skills' configs, but it does change system service state and network listeners — run only on machines you accept to persistently host monitoring.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install pg-game-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /pg-game-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.3.0
- 明确定位为“单台物理机多 Java 进程 + 自建 MySQL”场景,优化了文档表述和案例。 - 描述强化监控核心为“内存使用率”,突出适配游戏服大内存、高 GC 的特点。 - 架构图和方案说明更聚焦于多 Java 进程和单机典型部署结构。 - 现有环境变量、指标、告警、部署、排查等说明一致,未涉及接口或配置变更,文档表述更清晰。
v1.2.0
**v1.2.0 — Major usability and deployment improvements** - 全面改写 skill 文档,更贴近实际部署与维护需求,强化环境变量配置指引 - Ansible 脚本与采集 agent 明确支持环境变量方式注入,简化大规模部署 - 新增/更新 FAQ、监控快速部署、Dashboard 导入、故障排查等参考文档 - Dashboard、指标与告警规则相关内容精简整合,突出关键参数与监控要点 - 文件结构、流程说明、变量命名、trigger 规则等均更明确易用
v1.1.0
通用化改造:移除所有公司特定信息(IP/进程名/用户名/密码/飞书hook),修复rules.yml指标名错误,修复main.yml语法错误,补充3个真实Dashboard JSON
v1.0.0
pg-game-monitor v1.0.0 - 首次发布,基于 Prometheus 和 Grafana 的游戏服务器 JVM/MySQL 监控解决方案。 - 支持指标采集(JVM/MySQL)、告警(含飞书 Webhook 通知)、Dashboard 管理。 - 提供一键部署脚本与批量部署支持(Ansible、systemd)。 - 包含标准化告警规则、故障排查指南和扩容建议。 - 详细说明常用 PromQL 查询、Dashboard 导入及权限配置。 - 所有前提、依赖、组件通信结构和常见问题均已文档化。
元数据
Slug pg-game-monitor
版本 1.3.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Pg Game Monitor 是什么?

Prometheus + Grafana 监控方案,专为**单台物理机部署多个 Java 游戏进程 + 自建 MySQL**的场景设计。Java 进程通过 jstat/jcmd 无侵入采集 JVM 运行时指标(堆内存、新生代、老年代、GC、线程、类内存),MySQL 通过 pymysql 采集(Buffer Po... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 56 次。

如何安装 Pg Game Monitor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install pg-game-monitor」即可一键安装,无需额外配置。

Pg Game Monitor 是免费的吗?

是的,Pg Game Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Pg Game Monitor 支持哪些平台?

Pg Game Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Pg Game Monitor?

由 freepengyang(@freepengyang)开发并维护,当前版本 v1.3.0。

💬 留言讨论