360 Secure SkillHub
360 安全技能中心

Uptimecheck

核心功能:检测URL/API在线状态与响应时间,支持单条/批量检测(从文件读取),可自定义超时,结果可存至JSONL历史文件,支持筛选查询历史。典型场景:网站/服务监控、响应时间测量、集成CI/cron告警。输入为命令行参数,输出含状态标记、时长、统计,返回对应退出码适配自动化。

rogue-agent1
rogue-agent1
热度 51.94
最近更新 2026-05-11 17:37:27
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / 报告撰写 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add uptimecheck
Metadata
name
uptimecheck
description
Check if URLs and API endpoints are up or down with response times and status codes. Use when asked to monitor uptime, check if a website is down, measure HTTP response times, track endpoint health over time, or verify that services are responding. Supports batch checking from files, history tracking with JSONL storage, and configurable timeouts. Zero dependencies — pure Python stdlib.

uptimecheck ✅

Lightweight URL uptime monitor with response time measurement and history tracking.

Commands

Check endpoints

# Check one or more URLs
python3 scripts/uptimecheck.py check https://github.com https://api.example.com

# Check from a file (one URL per line, # comments supported)
python3 scripts/uptimecheck.py check -f urls.txt

# Save results to history for trend analysis
python3 scripts/uptimecheck.py check https://myapi.com --save

# Custom timeout (default 10s)
python3 scripts/uptimecheck.py check https://slow-api.com -t 30

View history

# Recent checks
python3 scripts/uptimecheck.py history

# Filter by URL
python3 scripts/uptimecheck.py history --url github.com

# Last N entries
python3 scripts/uptimecheck.py history -n 100

Output

  • ✅ for 2xx-4xx responses (client errors count as "up")
  • ❌ for 5xx, timeouts, DNS failures, connection refused
  • Response time in milliseconds
  • Summary with count of down endpoints

History Storage

Results saved to ~/.uptimecheck/checks.jsonl — one JSON object per line with url, status, ms, ok, timestamp.

Exit Codes

  • 0: All endpoints responding
  • 1: One or more endpoints down (useful for CI/cron alerting)