examples.jsonโข5.17 kB
[
{
"input": {
"task_title": "Disk Space Crisis Management",
"task_objective": "Identify and resolve critical disk space issues on production servers",
"task_context": "Our production web servers are experiencing performance degradation. Initial investigation points to low disk space. We need to quickly identify the root cause and free up space without affecting running services.",
"os_version": "Windows Server 2022",
"system_architecture": "x64",
"user_context": "Senior SRE",
"admin_status": "Yes",
"powershell_version": "7.3.4",
"primary_goal": "Free up at least 20% disk space on all drives",
"success_criteria_1": "Identify largest files and directories",
"success_criteria_2": "Provide safe cleanup recommendations",
"success_criteria_3": "Suggest long-term monitoring solution",
"tech_requirement_1": "Must not disrupt running services",
"tech_requirement_2": "Preserve all log files less than 7 days old",
"tech_requirement_3": "Generate a cleanup report",
"tech_constraint_1": "No system restarts allowed during business hours",
"tech_constraint_2": "Must maintain 30 days of IIS logs",
"tech_constraint_3": "SQL Server tempdb must not be modified",
"business_constraint_1": "Zero downtime during cleanup",
"business_constraint_2": "Compliance with data retention policies",
"related_systems": "IIS, SQL Server, File Servers",
"dependencies": "Enterprise monitoring system, Backup solutions",
"previous_attempts": "Tried Windows Disk Cleanup, but it didn't free enough space",
"stakeholders": "CTO, DevOps Team, Security Team",
"special_instruction_1": "Highlight any security concerns in findings",
"special_instruction_2": "Prioritize cleanup of non-production environments first",
"special_instruction_3": "Include rollback steps for each cleanup action",
"metric_1": "Percentage of disk space freed",
"metric_2": "Number of files cleaned up",
"metric_3": "Time taken to complete cleanup",
"target_value": "20%",
"question_1": "Are there any specific compliance requirements we should consider",
"question_2": "Should we implement automated cleanup for temporary files",
"question_3": "Who should approve the cleanup plan before execution"
},
"output": "# ๐จ Disk Space Emergency Response Plan\n\n## ๐ต๏ธโโ๏ธ Current State Analysis\n```powershell\n# Get disk space overview (run as admin for full details)\nGet-Volume | Where-Object {$_.DriveType -eq 'Fixed'} | \nSelect-Object DriveLetter, \n @{Name='Size(GB)';Expression={[math]::Round($_.Size/1GB, 2)}}, \n @{Name='Free(GB)';Expression={[math]::Round($_.SizeRemaining/1GB, 2)}},\n @{Name='%Free';Expression={[math]::Round(($_.SizeRemaining/$_.Size)*100, 2)}} |\nSort-Object -Property '%Free' -Descending |\nFormat-Table -AutoSize\n```\n\n## ๐ Deep Dive: Space Hogs\n```powershell\n# Find large directories (top 10)\n$targetDrive = \"C:\\\"\nGet-ChildItem -Path $targetDrive -Directory | \nForEach-Object {\n $size = (Get-ChildItem $_.FullName -Recurse -File | Measure-Object -Property Length -Sum).Sum\n [PSCustomObject]@{\n Directory = $_.FullName\n Size_GB = [math]::Round($size/1GB, 2)\n }\n} | Sort-Object -Property Size_GB -Descending | Select-Object -First 10 | Format-Table -AutoSize\n```\n\n## ๐งน Safe Cleanup Actions\n```powershell\n# 1. Clean Windows Temp files (run as admin)\nRemove-Item -Path \"C:\\Windows\\Temp\\*\" -Recurse -Force -ErrorAction SilentlyContinue\n\n# 2. Clean user temp files\nGet-ChildItem -Path \"C:\\Users\\*\\AppData\\Local\\Temp\" -Recurse | \n Where-Object { $_.CreationTime -lt (Get-Date).AddDays(-7) } | \n Remove-Item -Recurse -Force -ErrorAction SilentlyContinue\n\n# 3. Clear Windows Update cache (run as admin)\nStop-Service wuauserv -Force\nRemove-Item -Path \"C:\\Windows\\SoftwareDistribution\\*\" -Recurse -Force\nStart-Service wuauserv\n```\n\n## ๐ Monitoring Solution\n```powershell\n# Create a scheduled task to monitor disk space\n$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-NoProfile -WindowStyle Hidden -Command \"\n $disks = Get-Volume | Where-Object { $_.DriveType -eq ''Fixed'' -and $_.DriveLetter }\n $report = $disks | ForEach-Object {\n $pctFree = ($_.SizeRemaining / $_.Size) * 100\n if ($pctFree -lt 20) {\n Write-Warning \"Low disk space on $($_.DriveLetter): $([math]::Round($pctFree,1))% free\"\n }\n }\n # Send email if any disks are below threshold\n if ($report) {\n Send-MailMessage -From \"monitor@example.com\" -To \"admin@example.com\" -Subject \"Disk Space Alert\" -Body ($report -join \"`n\")\n }\n\"'\n$trigger = New-ScheduledTaskTrigger -Daily -At 8am\nRegister-ScheduledTask -Action $action -Trigger $trigger -TaskName \"Disk Space Monitor\" -Description \"Monitors disk space and sends alerts\"\n```\n\n## โ ๏ธ Important Notes\n- Always have a verified backup before cleanup\n- Monitor system stability after cleanup\n- Document all changes for audit purposes"
}
]