← 返回
内容创作

Website Monitor

Lightweight website uptime monitor. Check if URLs are up, measure response times, detect content changes via hashing, and verify expected content. Zero depen...
轻量级网站正常运行监控工具。检查URL是否可访问,测量响应时间,通过哈希检测内容变化,并验证预期内容。零依赖。
claudiodrusus
内容创作 clawhub v1.1.0 1 版本 99850.3 Key: 无需
★ 0
Stars
📥 1,334
下载
💾 45
安装
1
版本
#latest

概述

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)
  • --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

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-29 06:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,204
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,492
productivity

QR Code Generator

claudiodrusus
从文本、URL、WiFi凭据、vCard或任何数据生成二维码。当用户想要创建二维码、将链接分享为可扫描代码或生成...
★ 0 📥 2,584