360 Secure SkillHub
360 安全技能中心

Rr Reboot Report

该 Skill 通过 Bash 脚本把当前系统启动时间写入状态文件,后续运行时与上次记录对比,判断是否发生非预期重启,输出 CLEAN、REBOOTED 或 FIRST_RUN 状态;支持查看启动历史、重置状态与 JSON 输出,可配合 cron 或心跳机制定时检查。

elony-7
elony-7
热度 21.98
最近更新 2026-03-30 11:31:53
分类:安全依赖:代码执行 / 读写文件应用场景:自动化脚本 / DevOps / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add rr-reboot-report
Metadata
name
rr-reboot-report
description
Detect unexpected system reboots and alert when the system comes back online. Tracks boot history and flags suspicious restarts.
metadata
{"openclaw":{"emoji":"🔄","requires":{"bins":["bash"]}}}

RR Reboot Report

Detect unexpected reboots and track boot history. Useful for security monitoring — flags when a system restarts unexpectedly.

Quick Start

# Check for unexpected reboot (run at startup or on first heartbeat)
bash {baseDir}/scripts/check-reboot.sh

# View boot history
bash {baseDir}/scripts/check-reboot.sh --history

# Reset state (mark current boot as known)
bash {baseDir}/scripts/check-reboot.sh --reset

How It Works

  1. On first run, records current boot time to state file
  2. On subsequent runs, compares current boot time with last known
  3. If boot time changed unexpectedly → alerts
  4. State file: ~/.reboot-check-state (customizable with --state)

Output

STATUS: CLEAN       — No reboot since last check
STATUS: REBOOTED    — System rebooted since last check
STATUS: FIRST_RUN   — First time running, recording boot time

Integration

Use with cron or heartbeat systems:

# Cron: check every hour
0 * * * * /path/to/check-reboot.sh >> /var/log/reboot-check.log

# Or in a heartbeat script
RESULT=$(bash check-reboot.sh)
[[ "$RESULT" == *"REBOOTED"* ]] && echo "ALERT: Unexpected reboot!"

Options

  • --state FILE — State file path (default: ~/.reboot-check-state)
  • --history — Show recorded boot history
  • --reset — Reset state to current boot
  • --json — Output as JSON