system-info-telemetry
暂无简介
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 13
- Forks
- 2
03 SKILL.md 正文
/system-info-telemetry
When to Use
- Monitor Codespaces resource usage before launching sandbox workloads
- Detect resource contention (CPU steal, memory pressure) and trigger circuit breaker
- Build health-check endpoint reporting real hardware metrics
- Pair with [[statsd-metrics-streaming]] to push metrics to Datadog
Do NOT use for
- Container resource limits (query cgroup v2 files directly for accuracy inside containers)
- Real-time per-process profiling (use [[process-list-monitoring]])
Core metrics snapshot
import si from 'systeminformation'
async function resourceSnapshot() {
const [cpu, mem, disk, net] = await Promise.all([
si.currentLoad(),
si.mem(),
si.fsStats(),
si.networkStats(),
])
return {
cpu: {
loadPercent: parseFloat(cpu.currentLoad.toFixed(1)),
coresLoaded: cpu.cpus.filter(c => c.load > 80).length,
},
memory: {
totalGb: (mem.total / 1024**3).toFixed(2),
usedGb: (mem.used / 1024**3).toFixed(2),
freeGb: (mem.free / 1024**3).toFixed(2),
swapUsed: (mem.swapused / 1024**3).toFixed(2),
},
disk: {
readMbps: (disk.rx_sec / 1024**2).toFixed(1),
writeMbps: (disk.wx_sec / 1024**2).toFixed(1),
},
net: net[0] ? {
rxMbps: (net[0].rx_sec / 1024**2).toFixed(1),
txMbps: (net[0].tx_sec / 1024**2).toFixed(1),
} : null,
}
}
Pre-flight check before heavy workloads
async function preflightCheck(): Promise<{ ok: boolean; reason?: string }> {
const mem = await si.mem()
const load = await si.currentLoad()
const freeMemMb = mem.available / 1024**2
if (freeMemMb < 256) {
return { ok: false, reason: `low memory: ${freeMemMb.toFixed(0)}MB free` }
}
if (load.currentLoad > 90) {
return { ok: false, reason: `high CPU: ${load.currentLoad.toFixed(0)}%` }
}
return { ok: true }
}
Periodic metrics push to StatsD
import StatsD from 'node-statsd'
const stats = new StatsD({ prefix: 'yamtam.host.' })
async function startMetricsLoop(intervalMs = 15_000): Promise<void> {
setInterval(async () => {
const snap = await resourceSnapshot()
stats.gauge('cpu.load_pct', snap.cpu.loadPercent)
stats.gauge('memory.used_gb', parseFloat(snap.memory.usedGb))
stats.gauge('memory.free_gb', parseFloat(snap.memory.freeGb))
}, intervalMs)
}
Anti-Fake-Pass Checklist
❌ si.cpu() vs si.currentLoad() — cpu() is static info; currentLoad() is live
❌ mem.available != mem.free — available includes reclaimable cache (use available)
❌ fsStats() averages since boot — call twice with interval for delta
❌ Inside Docker: host CPU/memory, not container limits (query /sys/fs/cgroup)
❌ Calling si.* in tight loop — each call spawns child process, blocks event loop
❌ No platform check — some metrics (battery, temperature) crash on server VMs
04 同仓库更多 Skills
openai--sentry--sentry
Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.
ito-basket-compare
Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.
implementing-network-traffic-baselining
Build network traffic baselines from NetFlow/IPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly/daily traffic pattern profiling
detecting-evasion-techniques-in-endpoint-logs
Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.
implementing-microsegmentation-with-guardicore
Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.
ramdisk-tmpfs-patterns
暂无简介