Website Monitor

👤 claudiodrusus 📦 v1.1.0 ⭐ 4.5 ⬇️ 1.7K 下载
🔒 IT运维与安全 免费

📖 技能介绍


name: website-monitor description: Lightweight website uptime monitor. Check if URLs are up, measure response times, detect content changes via hashing, and verify expected content. Zero dependencies. triggers: - check website - is site up - monitor url - website status - uptime check - ping website


Website Monitor

A zero-dependency Python tool for checking website availability, measuring response times, and detecting content changes. Uses only Python's standard library (urllib) — no requests, no aiohttp, no external packages.

Features

  • Uptime checking: Verify any URL returns the expected HTTP status code
  • Response time measurement: Precise millisecond timing for each request
  • Content change detection: SHA-256 based hashing to detect when page content changes between checks
  • Text verification: Confirm that specific text appears in the response body
  • Multi-URL support: Check multiple sites in a single command
  • JSON output: Machine-readable output for integration with other tools and dashboards
  • Exit codes: Returns exit code 1 if any site is down, making it perfect for shell scripts and cron jobs

Usage Examples

Simple uptime check:

python main.py https://example.com
# ✅ https://example.com
#    Status: 200
#    Response: 142ms
#    Size: 1256 bytes
#    Hash: fb91d75a6bb43078

Check multiple sites at once:

python main.py example.com google.com github.com

Detect content changes (compare against a previous hash):

python main.py https://example.com --hash-check fb91d75a6bb43078
# Shows "Changed: YES ⚠️" or "Changed: No"

Verify a page contains expected text:

python main.py https://status.example.com --contains "All Systems Operational"

Expect a specific status code (e.g., redirect):

python main.py https://old.example.com --expect 301

JSON output for scripting:

python main.py example.com github.com --json | jq '.[] | select(.up == false)'

Use in a cron job or script:

python main.py https://mysite.com || echo "ALERT: Site is down!" | mail -s "Downtime Alert" admin@example.com

Command Line Options

  • urls — One or more URLs to check (auto-prepends https:// if missing)
  • --timeout N — Request timeout in seconds (default: 10)
  • --expect N — Expected HTTP status code (default: 200)

    想要更强大的技能插件,就来小葱技能站7w4.net看看吧。

  • --contains TEXT — Verify response body contains this string
  • --hash-check HASH — Previous content hash to compare against for change detection
  • --json — Output results as JSON array

Exit Codes

  • 0 — All sites are up and match expectations
  • 1 — One or more sites are down or failed checks

🤖 AI 评测

整体质量良好,零依赖设计让它安装使用非常简便,核心功能齐全且实用,文档示例丰富易理解。适合需要简单网站监控的开发者。不过在检查多个网站时速度较慢,遇到网络波动时没有自动重试,偶尔会出现误报。追求稳定可靠的生产级监控可能需要考虑其他方案。

📊 多维度评分

适应性4.4
规范性4.3
有效性4.6
可靠性4.7
可信度4.5

📁 包含文件 (3 个)

📄 SKILL.md 2.6 KB
📄 _meta.json 134 B
📄 main.py 4 KB