← 返回 Skills 市场
Ioc Patrol Report
作者
onlyloveher
· GitHub ↗
· v1.0.1
· MIT-0
116
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ioc-patrol-report-cn
功能描述
🏢 IOC智能运维报告生成器 - 为智能建筑/园区自动生成专业巡检报告。分析设备状态、报警记录、能耗数据、工单进度,生成日报/周报。支持PostgreSQL数据库连接,输出Markdown/HTML格式。适用于物业管理、商业综合体、工业园区、医院学校等智能建筑运维场景。
使用说明 (SKILL.md)
🏢 IOC 智能巡检报告
为智能建筑/园区自动生成专业巡检报告
✨ 核心功能
| 功能模块 | 描述 |
|---|---|
| 📊 设备状态巡检 | 分析设备在线率、故障分布、运行状态 |
| 🚨 报警处理分析 | 统计报警数量、响应时长、处理率、重复报警 |
| ⚡ 能耗数据分析 | 对比昨日/上周能耗,识别异常用能点 |
| 📝 工单进度追踪 | 统计工单完成率、SLA达成情况、积压情况 |
| 💡 智能建议生成 | 基于数据自动生成运维优化建议 |
🚀 快速开始
安装
clawhub install ioc-patrol-report
配置数据源
编辑 ~/.openclaw/skills/ioc-patrol-report/config.yaml:
database:
host: localhost
port: 5432
name: ioc_db
user: admin
password: ${DB_PASSWORD} # 建议使用环境变量
tables:
devices: devices # 设备表
alarms: alarms # 报警表
work_orders: work_orders # 工单表
energy: energy_records # 能耗表
report:
company_name: "XX物业管理有限公司"
project_name: "XX商业综合体"
output_dir: "./reports"
生成报告
# 生成今日巡检报告
cd skills/ioc-patrol-report
uv run scripts/generate_report.py --type daily
# 生成指定日期报告
uv run scripts/generate_report.py --type daily --date 2026-03-20
# 生成本周巡检报告
uv run scripts/generate_report.py --type weekly --week 2026-W12
📋 报告示例
日报输出格式
# 📊 IOC智能巡检日报 - 2026-03-20
## 一、设备状态总览
| 类型 | 总数 | 在线 | 离线 | 故障 | 在线率 |
|------|------|------|------|------|--------|
| 空调 | 128 | 125 | 2 | 1 | 97.7% |
| 照明 | 356 | 354 | 2 | 0 | 99.4% |
| 电梯 | 24 | 24 | 0 | 0 | 100% |
| 消防 | 89 | 89 | 0 | 0 | 100% |
## 二、报警处理情况
- 今日报警总数:23 条
- 已处理:21 条
- 处理中:2 条
- 平均响应时间:8.5 分钟
- 处理率:91.3%
### 重点关注报警
1. 🔴 3F-空调机组A异常(处理中)
2. 🟡 地下室照明回路故障(已处理)
## 三、能耗分析
| 能源类型 | 今日用量 | 昨日用量 | 环比 |
|----------|----------|----------|------|
| 电(kWh) | 12,345 | 12,100 | +2.0% |
| 水(m³) | 456 | 480 | -5.0% |
| 天然气(m³) | 123 | 130 | -5.4% |
## 四、工单进度
- 新增工单:5 个
- 已完成:4 个
- 进行中:3 个
- SLA达成率:92%
## 五、运维建议
1. ⚠️ 3F空调机组需重点关注,建议安排检修
2. ✅ 能耗整体平稳,用水量持续下降,节水措施见效
3. 📝 建议增加地下室照明巡检频次
---
*报告生成时间:2026-03-20 08:00*
*IOC智能运维系统*
📖 使用案例
案例1:商业综合体日常巡检
场景:某商业综合体物业每天需要生成巡检报告
配置:
report:
company_name: "XX物业管理公司"
project_name: "XX购物中心"
定时任务:
# crontab -e
0 8 * * * cd /root/clawd/skills/ioc-patrol-report && uv run scripts/generate_report.py --type daily
案例2:工业园区周报汇总
场景:工业园区每周汇总运维数据
配置:
report:
company_name: "XX工业园区"
project_name: "A区厂房"
weekly_summary: true
执行:
# 每周一早8点生成
0 8 * * 1 uv run scripts/generate_report.py --type weekly
案例3:医院智能运维
场景:医院后勤部门需要重点关注设备运行
自定义配置:
priority_devices:
- type: "医用气体"
alert_threshold: 99.9% # 可用性要求
- type: "净化空调"
alert_threshold: 99%
- type: "电梯"
alert_threshold: 99.5%
案例4:数据中心巡检
场景:数据中心需要严格监控温湿度和电力
自定义指标:
custom_metrics:
temperature:
range: [18, 27] # 合规范围
alert_deviation: 2 # 偏差告警阈值
humidity:
range: [40, 60]
ups_load:
max: 80% # 负载上限
⚙️ 高级配置
自定义报告模板
编辑 assets/report-template.md:
# {{company_name}} 巡检报告
## {{project_name}} - {{date}}
{% for section in sections %}
{{ section.content }}
{% endfor %}
自定义分析规则
编辑 scripts/analyze.py:
def custom_kpi(df):
"""自定义KPI计算"""
return {
'availability': df['online'] / df['total'],
'efficiency': df['output'] / df['input']
}
def anomaly_detection(df):
"""能耗异常检测"""
threshold = df['value'].mean() * 1.5
return df[df['value'] > threshold]
📁 目录结构
ioc-patrol-report/
├── SKILL.md # 本文档
├── package.json # 技能配置
├── config.yaml # 数据源配置
├── scripts/
│ ├── generate_report.py # 主程序
│ ├── analyze.py # 分析模块
│ └── db_connector.py # 数据库连接
├── assets/
│ └── report-template.md # 报告模板
├── references/
│ ├── ioc-knowledge.md # IOC知识库
│ └── db-schema.md # 数据库结构说明
└── tests/
└── test_report.py # 单元测试
🔧 技术要求
- Python >= 3.10
- PostgreSQL >= 12
- 必需依赖:psycopg2-binary, pyyaml, pandas, jinja2
📊 适用场景
| 场景 | 报告周期 | 重点关注 |
|---|---|---|
| 商业综合体 | 日报/周报 | 客流、能耗、设备 |
| 工业园区 | 周报/月报 | 设备运行、能耗成本 |
| 医院学校 | 日报 | 关键设备、环境参数 |
| 数据中心 | 实时/日报 | 温湿度、电力、网络 |
| 智慧社区 | 周报 | 安防、能耗、设备 |
让运维报告自动化、智能化 📊
安全使用建议
Key things to consider before installing or running this skill:
- Do NOT run the packaged code as-is. The repo contains a config.yaml with plaintext credentials for host hightop.xin (port 55432) and database 'sunway'. If you run the skill without editing the config, it will attempt to connect to that external database instead of your own.
- Treat the embedded credentials as a red flag: remove or overwrite config.yaml, or replace it with a template that contains no real credentials. Prefer using environment variables (DB_HOST, DB_NAME, DB_USER, DB_PASSWORD) as suggested in SKILL.md.
- Inspect scripts/generate_report.py yourself (or run in an isolated/sandboxed environment) before giving it network access. Note the script issues many SELECT queries (including personnel/access tables) which may expose sensitive data if pointed at your DB.
- If you need to use this skill, create and point it at a dedicated, access-controlled database or a read-only user with minimal privileges. Verify queries and limit table access to only the columns required for reporting.
- The code has small bugs/rough edges (duplicate except blocks; an except path calls a non-existent get_mock_data()), which suggests the package was not carefully audited — treat it as untrusted sample code until cleaned up.
If you want, I can: (1) show the exact lines in config.yaml and generate_report.py that are most concerning, (2) produce a safe config template you can drop in place, or (3) advise how to run it in an isolated container with no network access.
功能分析
Type: OpenClaw Skill
Name: ioc-patrol-report-cn
Version: 1.0.1
The skill bundle contains hardcoded plaintext database credentials for an external host (hightop.xin) within the 'config.yaml' file, including a password and the 'postgres' administrative user. While the primary script 'scripts/generate_report.py' appears to function as a legitimate reporting tool, the inclusion of active remote credentials and the use of an external database by default is highly irregular and poses a security risk. There is no explicit evidence of data exfiltration or malicious intent against the user's local environment, but the hardcoded secrets and external connectivity justify a suspicious classification.
能力评估
Purpose & Capability
The skill claims to generate reports from a PostgreSQL data source and the code (scripts/generate_report.py) implements DB queries as expected. However, the repository includes a config.yaml with a hard-coded remote database (host: hightop.xin, port: 55432, db: sunway, user: postgres, password: "Q9iT6>^bZsPIX}A&"). Packaging an unrelated remote DB credential is unnecessary for the stated purpose and strongly inconsistent with expected practice (the SKILL.md suggests using environment variables or a local config).
Instruction Scope
SKILL.md instructs users to edit ~/.openclaw/skills/ioc-patrol-report/config.yaml or use environment variables, but load_config() will prefer the included config.yaml if present. That means running the skill without editing will attempt to connect to the packaged external DB rather than your own. The runtime instructions do not warn about the shipped config with credentials. The code queries multiple tables (including personnel/access tables) which may contain sensitive PII — callers should ensure it connects only to their intended DB.
Install Mechanism
No install script or remote downloads are included; this is an instruction-plus-source package. There are no URL downloads or extract steps in the manifest. Dependencies are normal Python libs (psycopg2, pyyaml).
Credentials
skill.yaml declares DB_HOST/DB_PORT/DB_NAME/DB_USER/DB_PASSWORD as required configuration (reasonable for a DB-backed report tool). But the repository simultaneously ships a full config.yaml with plaintext credentials for an external host. That embedded secret is disproportionate and unnecessary. Also the package metadata listed at the top said 'Required env vars: none' which contradicts skill.yaml — another inconsistency.
Persistence & Privilege
The skill does not request elevated platform privileges and has always:false. It does not modify other skills or system-wide configs. Running it will create report files under the skill's reports/ directory (expected behavior).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ioc-patrol-report-cn - 安装完成后,直接呼叫该 Skill 的名称或使用
/ioc-patrol-report-cn触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added detailed documentation (SKILL.md) covering core features, installation, configuration examples, report formats, use cases, advanced customization, and technical requirements.
- Clarified support for automatic patrol/maintenance report generation for smart buildings and campuses, with PostgreSQL connection, and Markdown/HTML output.
- Outlined common application scenarios, configuration steps, and sample use cases for commercial complexes, industrial parks, hospitals, and data centers.
- Provided advanced configuration instructions for custom templates and analysis rules.
- No code or feature changes; this update mainly adds user guidance and comprehensive instructions.
元数据
常见问题
Ioc Patrol Report 是什么?
🏢 IOC智能运维报告生成器 - 为智能建筑/园区自动生成专业巡检报告。分析设备状态、报警记录、能耗数据、工单进度,生成日报/周报。支持PostgreSQL数据库连接,输出Markdown/HTML格式。适用于物业管理、商业综合体、工业园区、医院学校等智能建筑运维场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 116 次。
如何安装 Ioc Patrol Report?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ioc-patrol-report-cn」即可一键安装,无需额外配置。
Ioc Patrol Report 是免费的吗?
是的,Ioc Patrol Report 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Ioc Patrol Report 支持哪些平台?
Ioc Patrol Report 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Ioc Patrol Report?
由 onlyloveher(@onlyloveher)开发并维护,当前版本 v1.0.1。
推荐 Skills