server-health
Check Windows Server health: CPU, memory, disk, services, event logs, uptime. Use when user asks about server performance or wants a health check.
When & Why to Use This Skill
This Claude skill provides a comprehensive diagnostic toolkit for Windows Server health monitoring. It automates the collection of critical performance metrics including CPU load, memory utilization, disk space, and service status, allowing IT professionals to perform instant health checks and identify system bottlenecks through PowerShell-driven data extraction.
Use Cases
- Performance Troubleshooting: Identify high-resource processes and CPU spikes when a server is reported as slow or unresponsive.
- Storage Capacity Management: Monitor disk space across all logical drives with automated warnings for low-space conditions to prevent system crashes.
- System Stability Audits: Review the last 24 hours of critical event logs and application errors to diagnose recurring system failures.
- Service Availability Checks: Verify that essential Windows services like DNS, Netlogon, and W32Time are running and configured correctly.
- Maintenance Planning: Check system uptime and memory health to determine if a server requires a scheduled reboot or hardware upgrade.
| name | server-health |
|---|---|
| description | "Check Windows Server health: CPU, memory, disk, services, event logs, uptime. Use when user asks about server performance or wants a health check." |
| license | MIT |
Server Health Check Skill
When to Activate
- User mentions: health check, performance, slow server, disk space, memory, CPU
- User asks "is the server OK?" or "check the server"
- User reports application slowness
Quick Health Summary (One-Liner)
# Fast health snapshot
$cpu = (Get-CimInstance Win32_Processor).LoadPercentage
$mem = Get-CimInstance Win32_OperatingSystem
$memPct = [math]::Round((($mem.TotalVisibleMemorySize - $mem.FreePhysicalMemory) / $mem.TotalVisibleMemorySize) * 100)
$disk = Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | Select-Object DeviceID, @{N='FreeGB';E={[math]::Round($_.FreeSpace/1GB)}}, @{N='UsedPct';E={[math]::Round((($_.Size - $_.FreeSpace) / $_.Size) * 100)}}
$uptime = (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
Write-Host "CPU: $cpu% | Memory: $memPct% | Uptime: $($uptime.Days)d $($uptime.Hours)h"
$disk | Format-Table -AutoSize
Detailed Health Checks
CPU Analysis
# Current CPU with top processes
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 Name, CPU, WorkingSet64
# CPU over time (5 samples, 2 sec apart)
Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 2 -MaxSamples 5
Memory Analysis
# Memory breakdown
$os = Get-CimInstance Win32_OperatingSystem
[PSCustomObject]@{
'Total GB' = [math]::Round($os.TotalVisibleMemorySize / 1MB, 2)
'Free GB' = [math]::Round($os.FreePhysicalMemory / 1MB, 2)
'Used %' = [math]::Round((($os.TotalVisibleMemorySize - $os.FreePhysicalMemory) / $os.TotalVisibleMemorySize) * 100)
}
# Top memory consumers
Get-Process | Sort-Object WorkingSet64 -Descending | Select-Object -First 10 Name, @{N='MemMB';E={[math]::Round($_.WorkingSet64/1MB)}}
Disk Analysis
# All fixed disks
Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | ForEach-Object {
[PSCustomObject]@{
Drive = $_.DeviceID
'Size GB' = [math]::Round($_.Size / 1GB)
'Free GB' = [math]::Round($_.FreeSpace / 1GB)
'Used %' = [math]::Round((($_.Size - $_.FreeSpace) / $_.Size) * 100)
Status = if (($_.FreeSpace / $_.Size) -lt 0.1) { '⚠️ LOW' } else { '✅ OK' }
}
}
Critical Services
# Check essential services
$criticalServices = @('wuauserv', 'W32Time', 'EventLog', 'Netlogon', 'DNS', 'DFSR')
$criticalServices | ForEach-Object {
$svc = Get-Service -Name $_ -ErrorAction SilentlyContinue
if ($svc) {
[PSCustomObject]@{
Name = $svc.DisplayName
Status = $svc.Status
StartType = $svc.StartType
}
}
}
Recent Errors (Event Log)
# Last 24h errors
Get-WinEvent -FilterHashtable @{
LogName = 'System', 'Application'
Level = 1, 2 # Critical, Error
StartTime = (Get-Date).AddHours(-24)
} -MaxEvents 20 -ErrorAction SilentlyContinue |
Select-Object TimeCreated, LogName, LevelDisplayName, Message
Thresholds & Alerts
| Metric | Warning | Critical |
|---|---|---|
| CPU | > 80% sustained | > 95% sustained |
| Memory | > 85% used | > 95% used |
| Disk | < 15% free | < 5% free |
| Uptime | > 90 days (patch!) | > 180 days |