运维智能巡检系统 - 全方位自动化巡检解决方案
这是一个全面的运维智能巡检系统,支持多层级的自动化巡检,包括基础资源、中间件、容器平台、日志、业务指标等多个维度。系统会自动检测目标环境中已安装的软件和服务,仅对存在的组件进行真实巡检。
bash
python3 intelligent_inspection.py
bash
python3 intelligent_inspection.py --export
bash
# 仅执行基础资源巡检
python3 intelligent_inspection.py --layers resource
# 执行基础资源和中间件巡检
python3 intelligent_inspection.py --layers resource middleware
# 执行所有层级巡检(默认)
python3 intelligent_inspection.py --layers all
text
================================================================================
智能运维巡检报告
巡检时间: 2026-06-04 09:49:19
主机名: your-hostname
操作系统: Linux 6.8.0-117-generic
================================================================================
执行: 基础资源巡检
健康评分: 100/100
摘要: 系统资源状态良好
✓ CPU使用率
当前值: 2.3%
阈值: P1: >95% | P2: >85%
状态: 正常 | 风险等级: 正常
✓ 内存使用率
当前值: 67.4% (2.55GB/3.78GB)
阈值: P1: >95% | P2: >85%
状态: 正常 | 风险等级: 正常
================================================================================
巡检总结
================================================================================
总体健康评分: 98/100
P1级别问题: 0个
P2级别问题: 1个
系统状态: 优秀 ✓
等级名称说明分数影响P1严重核心功能不可用,需要立即处理-20分P2警告功能受损或存在风险,需要尽快处理-10分P3提示存在潜在问题,建议处理-5分
评分等级:
bash
pip install psutil
bash
pip install requests # 用于Elasticsearch检查
系统会自动检测以下中间件,仅对已安装的进行巡检:
使用crontab配置定时巡检:
bash
# 每15分钟执行一次基础资源巡检
*/15 * * * * /usr/bin/python3 /path/to/intelligent_inspection.py --layers resource --export
# 每小时执行一次完整巡检
0 * * * * /usr/bin/python3 /path/to/intelligent_inspection.py --export
根据巡检结果配置告警:
文件说明intelligent_inspection.py主巡检脚本README.md详细巡检文档README_INSPECTION.md使用指南skill.jsonSkill元数据配置
MIT License
@43622283
详细文档请查看: