360 Secure SkillHub
360 安全技能中心

Uptime Tool

该 Skill 提供 uptime-tool 命令,用于显示系统自开机以来的运行时长、活跃用户会话和 CPU 负载均值,可通过命令行选项输出 JSON、查询开机时间、持续监控、按阈值告警以及比较历史状态,适用于健康检查、重启验证和容量监控。

dinghaibin
dinghaibin
热度 28.83
最近更新 2026-05-11 17:48:08
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / DevOps

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add uptime-tool
Metadata
name
uptime-tool
description
Show system uptime, load average, active user count, and boot time. Use for system health checks, monitoring, and diagnostics.

Uptime Tool — System Uptime & Load Monitor

Display how long the system has been running since last boot, current user sessions, and CPU load averages. Essential for health checks, reboot verification, and capacity monitoring.

Quick Start

# Show system uptime
uptime-tool

# Show uptime plus JSON output for monitoring
uptime-tool --json

Usage

uptime-tool [OPTIONS]

Options:
  --json       Output as structured JSON
  --pretty     Human-readable format with emojis (default)
  --since      Show boot time timestamp
  --seconds    Show uptime in seconds only
  --compare    Compare with last-known value (requires --state-file)
  --watch N    Monitor continuously, N second intervals
  --alert N    Alert if uptime < N seconds (short uptime = recent reboot)

Examples

# Standard uptime output
uptime-tool

# Machine-readable JSON for monitoring
uptime-tool --json

# Show boot time
uptime-tool --since

# Watch every 30 seconds
uptime-tool --watch 30

# Alert if system just rebooted (< 60 seconds uptime)
uptime-tool --alert 60

# Uptime in seconds for scripts
uptime-tool --seconds

Features

  • Standard uptime display with load averages
  • JSON output for monitoring pipelines
  • Boot time detection (when did the system start?)
  • Continuous watch mode for real-time monitoring
  • Alert thresholds for restart detection
  • Compare mode detects unexpected reboots
  • Cross-platform — works on Linux, macOS, BSD