Resource Analysis Skill
This skill provides detailed guidance for analyzing system resource usage from sosreport archives, including memory, CPU, disk space, and process information.
When to Use This Skill
Use this skill when:
- Analyzing the
/sosreport:analyze command's resource analysis phase
- Investigating performance issues or resource bottlenecks
- Identifying resource exhaustion problems
- Correlating resource usage with system failures
Prerequisites
- Sosreport archive must be extracted to a working directory
- Path to the sosreport root directory must be known
- Understanding of Linux resource management
Key Resource Data Locations in Sosreport
Memory Information:
sos_commands/memory/free - Memory usage snapshot
proc/meminfo - Detailed memory statistics
sos_commands/memory/swapon_-s - Swap usage
proc/buddyinfo - Memory fragmentation
CPU Information:
sos_commands/processor/lscpu - CPU architecture and features
proc/cpuinfo - Detailed CPU information
sos_commands/processor/turbostat - CPU frequency and power states (if available)
uptime - Load averages
Disk Information:
sos_commands/filesys/df_-al - Filesystem usage
sos_commands/block/lsblk - Block device information
sos_commands/filesys/mount - Mounted filesystems
proc/diskstats - Disk I/O statistics
Process Information:
sos_commands/process/ps_auxwww - Process list with details
sos_commands/process/top - Process snapshot (if available)
proc/[pid]/ - Per-process information
Implementation Steps
Step 1: Analyze Memory Usage
Parse free command output:
# Check if free output exists
if [ -f sos_commands/memory/free ]; then
cat sos_commands/memory/free
fi
Extract memory metrics:
# Parse /proc/meminfo for detailed stats
if [ -f proc/meminfo ]; then
grep -E "^(MemTotal|MemFree|MemAvailable|Buffers|Cached|SwapTotal|SwapFree|Dirty|Slab):" proc/meminfo
fi
Calculate memory usage percentage:
- Total memory = MemTotal
- Used memory = MemTotal - MemAvailable
- Usage percentage = (Used / Total) * 100
- Parse from
free output or calculate from meminfo
Check for memory pressure indicators:
# Look for OOM events in logs
grep -i "out of memory\|oom killer" sos_commands/logs/journalctl_--no-pager 2>/dev/null
# Check swap usage
if [ -f sos_commands/memory/swapon_-s ]; then
cat sos_commands/memory/swapon_-s
fi
Identify memory issues:
- Memory usage > 90% → Critical
- Memory usage > 80% → Warning
- Heavy swap usage (>50% swap used) → Performance issue
- OOM killer events → Critical memory exhaustion
Step 2: Analyze CPU Usage
Extract CPU information:
# Get CPU count and model
if [ -f sos_commands/processor/lscpu ]; then
grep -E "^(CPU\(s\)|Model name|Thread|Core|Socket|CPU MHz):" sos_commands/processor/lscpu
fi
Check load averages:
# Parse uptime for load averages
if [ -f uptime ]; then
cat uptime
fi
# Or from proc/loadavg
if [ -f proc/loadavg ]; then
cat proc/loadavg
fi
Interpret load averages:
- Load average format: 1-min, 5-min, 15-min
- Compare with CPU count from lscpu
- Load > CPU count → System overloaded
- Load >> CPU count (2x or more) → Critical overload
Check for CPU throttling:
# Look for thermal throttling in logs
grep -i "throttl\|temperature\|thermal" sos_commands/logs/journalctl_--no-pager 2>/dev/null | head -20
Identify CPU issues:
- 1-min load > 2x CPU count → Critical
- 5-min load > CPU count → Warning
- Thermal throttling present → Hardware/cooling issue
Step 3: Analyze Disk Usage
Parse df output for filesystem usage:
if [ -f sos_commands/filesys/df_-al ]; then
# Skip header and special filesystems, show only regular filesystems
grep -v "^Filesystem\|tmpfs\|devtmpfs\|overlay" sos_commands/filesys/df_-al | grep -v "^$"
fi
Identify full or nearly-full filesystems:
# Extract filesystems with usage > 85%
if [ -f sos_commands/filesys/df_-al ]; then
awk 'NR>1 && $5+0 >= 85 {print $5, $6, $1}' sos_commands/filesys/df_-al | grep -v "tmpfs\|devtmpfs"
fi
Check disk I/O errors:
# Look for I/O errors in logs
grep -i "i/o error\|read error\|write error\|bad sector" var/log/dmesg 2>/dev/null
grep -i "i/o error\|read error\|write error" sos_commands/logs/journalctl_--no-pager 2>/dev/null | head -20
Analyze block devices:
if [ -f sos_commands/block/lsblk ]; then
cat sos_commands/block/lsblk
fi
Identify disk issues:
- Filesystem > 95% full → Critical
- Filesystem > 85% full → Warning
- I/O errors present → Hardware issue
- Root filesystem full → System stability risk
Step 4: Analyze Process Information
Parse ps output:
if [ -f sos_commands/process/ps_auxwww ]; then
# Show header
head -1 sos_commands/process/ps_auxwww
fi
Find top CPU consumers:
# Sort by CPU usage (column 3), show top 10
if [ -f sos_commands/process/ps_auxwww ]; then
tail -n +2 sos_commands/process/ps_auxwww | sort -k3 -rn | head -10
fi
Find top memory consumers:
# Sort by memory usage (column 4), show top 10
if [ -f sos_commands/process/ps_auxwww ]; then
tail -n +2 sos_commands/process/ps_auxwww | sort -k4 -rn | head -10
fi
Check for zombie processes:
# Look for processes in Z state
if [ -f sos_commands/process/ps_auxwww ]; then
grep " Z " sos_commands/process/ps_auxwww || echo "No zombie processes found"
fi
Count processes by state:
# Count processes by state (R=running, S=sleeping, D=uninterruptible, Z=zombie, T=stopped)
if [ -f sos_commands/process/ps_auxwww ]; then
tail -n +2 sos_commands/process/ps_auxwww | awk '{print $8}' | cut -c1 | sort | uniq -c
fi
Identify process issues:
- Zombie processes present → Parent process not reaping children
- Many processes in D state → I/O bottleneck
- Single process using >80% memory → Memory leak or expected behavior
- Many processes using high CPU → CPU contention
Step 5: Correlate Resource Usage with Issues
Cross-reference with logs:
- If high memory usage, check for OOM events in logs
- If high disk usage, check for disk full errors
- If high load, check for performance-related errors
Identify resource exhaustion patterns:
- Memory exhaustion → OOM killer → Service crashes
- Disk full → Write failures → Application errors
- CPU overload → Timeouts → Request failures
Build timeline:
- When did resource issues start?
- Correlate with log timestamps
- Identify triggering event if possible
Step 6: Generate Resource Analysis Summary
Create a structured summary with the following sections:
Memory Summary:
- Total memory
- Used memory (GB and %)
- Available memory
- Swap usage (GB and %)
- Memory pressure indicators (OOM events)
CPU Summary:
- CPU count and model
- Load averages (1-min, 5-min, 15-min)
- Load per CPU
- CPU issues (throttling, overload)
Disk Summary:
- Filesystems and usage percentages
- Full or nearly-full filesystems
- I/O errors count
- Most full filesystem
Process Summary:
- Total process count
- Top CPU consumers (top 5)
- Top memory consumers (top 5)
- Zombie process count
- Processes in uninterruptible sleep (D state)
Critical Resource Issues:
- List issues by severity
- Provide evidence (file paths, metrics)
- Suggest remediation
Error Handling
Missing resource files:
- If
free is missing, parse proc/meminfo directly
- If
ps is missing, check proc/ for process information
- Document missing data in summary
Parsing errors:
- Handle different output formats (free -h vs free -m)
- Account for locale differences in number formats
- Validate data before calculations
Incomplete data:
- Some sosreports may not include all resource files
- Indicate which metrics are unavailable
- Work with available data only
Output Format
The resource analysis should produce:
RESOURCE USAGE SUMMARY
======================
MEMORY
------
Total: {total_gb} GB
Used: {used_gb} GB ({used_pct}%)
Available: {available_gb} GB ({available_pct}%)
Buffers: {buffers_gb} GB
Cached: {cached_gb} GB
Swap Total: {swap_total_gb} GB
Swap Used: {swap_used_gb} GB ({swap_used_pct}%)
Status: {OK|WARNING|CRITICAL}
Issues:
- {memory_issue_description}
CPU
---
Model: {cpu_model}
CPU Count: {cpu_count}
Threads/Core: {threads_per_core}
Load Averages: {load_1m}, {load_5m}, {load_15m}
Load per CPU: {load_1m_per_cpu}, {load_5m_per_cpu}, {load_15m_per_cpu}
Status: {OK|WARNING|CRITICAL}
Issues:
- {cpu_issue_description}
DISK USAGE
----------
Filesystem Size Used Avail Use% Mounted on
{filesystem} {size} {used} {avail} {pct}% {mount}
Nearly Full Filesystems (>85%):
- {mount}: {pct}% full ({available} available)
I/O Errors: {count} errors found in logs
Status: {OK|WARNING|CRITICAL}
Issues:
- {disk_issue_description}
PROCESSES
---------
Total Processes: {total}
Running: {running}
Sleeping: {sleeping}
Zombie: {zombie}
Uninterruptible: {uninterruptible}
Top CPU Consumers:
1. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
2. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
3. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
Top Memory Consumers:
1. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
2. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
3. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
Status: {OK|WARNING|CRITICAL}
Issues:
- {process_issue_description}
CRITICAL RESOURCE ISSUES
------------------------
{severity}: {issue_description}
Evidence: {file_path}
Impact: {impact_description}
Recommendation: {remediation_action}
RECOMMENDATIONS
---------------
1. {actionable_recommendation}
2. {actionable_recommendation}
DATA SOURCES
------------
- Memory: {sosreport_path}/sos_commands/memory/free
- Memory: {sosreport_path}/proc/meminfo
- CPU: {sosreport_path}/sos_commands/processor/lscpu
- Load: {sosreport_path}/uptime
- Disk: {sosreport_path}/sos_commands/filesys/df_-al
- Processes: {sosreport_path}/sos_commands/process/ps_auxwww
Examples
Example 1: Memory Analysis
# Parse free command output
$ cat sos_commands/memory/free
total used free shared buff/cache available
Mem: 16277396 8123456 2145678 123456 6008262 7654321
Swap: 8388604 512000 7876604
# Interpretation:
# - Total RAM: ~16 GB
# - Used: ~8 GB (50%)
# - Available: ~7.6 GB (47%)
# - Swap used: ~500 MB (6%)
# Status: OK - healthy memory usage
Example 2: Disk Full Detection
# Find filesystems > 85% full
$ awk 'NR>1 && $5+0 >= 85' sos_commands/filesys/df_-al
/dev/sda1 50G 45G 5G 90% /
/dev/sdb1 100G 96G 4G 96% /var/log
# Critical: Root filesystem at 90%, /var/log at 96%
# Action required: Clean up disk space
Example 3: High Load Investigation
# Check load averages
$ cat uptime
14:23:45 up 10 days, 3:42, 2 users, load average: 8.45, 7.23, 6.12
# With lscpu showing 4 CPUs:
# Load per CPU: 2.1, 1.8, 1.5
# System is overloaded (load > 2x CPU count)
Tips for Effective Analysis
- Context matters: High resource usage isn't always bad - consider the workload
- Look for trends: Compare 1-min, 5-min, 15-min loads to see if issues are growing
- Correlate metrics: High load + high memory + disk full = multiple issues
- Check ratios: Usage percentages are more meaningful than absolute values
- Validate findings: Cross-reference with log analysis for confirmation
- Consider capacity: Is the system appropriately sized for its workload?
Common Resource Patterns
- Memory leak: Steadily increasing memory usage, eventual OOM
- Disk full: Application writes failing, log rotation issues
- CPU spike: Load average spike, potentially from runaway process
- I/O bottleneck: High load but low CPU usage, many D-state processes
- Swap thrashing: High swap usage, poor performance
- Zombie accumulation: Parent process bug not reaping children
Severity Classification
| Metric |
OK |
Warning |
Critical |
| Memory Usage |
< 80% |
80-90% |
> 90% |
| Swap Usage |
< 20% |
20-50% |
> 50% |
| Disk Usage |
< 85% |
85-95% |
> 95% |
| Load (per CPU) |
< 1.0 |
1.0-2.0 |
> 2.0 |
| Root FS Usage |
< 80% |
80-90% |
> 90% |
See Also
- Logs Analysis Skill: For finding resource-related errors in logs
- System Configuration Analysis Skill: For investigating service resource limits
- Network Analysis Skill: For network-related performance issues
1---2name: resource-analysis3description: Analyze system resource usage data from sosreport archives, extracting memory statistics, CPU load averages, disk space utilization, and process information from the sosreport directory structure to diagnose resource exhaustion, performance bottlenecks, and capacity issues4---5
6# Resource Analysis Skill
7
8This skill provides detailed guidance for analyzing system resource usage from sosreport archives, including memory, CPU, disk space, and process information.
9
10## When to Use This Skill
11
12Use this skill when:
13- Analyzing the `/sosreport:analyze` command's resource analysis phase
14- Investigating performance issues or resource bottlenecks
15- Identifying resource exhaustion problems
16- Correlating resource usage with system failures
17
18## Prerequisites
19
20- Sosreport archive must be extracted to a working directory
21- Path to the sosreport root directory must be known
22- Understanding of Linux resource management
23
24## Key Resource Data Locations in Sosreport
25
261. **Memory Information**:
27 - `sos_commands/memory/free` - Memory usage snapshot
28 - `proc/meminfo` - Detailed memory statistics
29 - `sos_commands/memory/swapon_-s` - Swap usage
30 - `proc/buddyinfo` - Memory fragmentation
31
322. **CPU Information**:
33 - `sos_commands/processor/lscpu` - CPU architecture and features
34 - `proc/cpuinfo` - Detailed CPU information
35 - `sos_commands/processor/turbostat` - CPU frequency and power states (if available)
36 - `uptime` - Load averages
37
383. **Disk Information**:
39 - `sos_commands/filesys/df_-al` - Filesystem usage
40 - `sos_commands/block/lsblk` - Block device information
41 - `sos_commands/filesys/mount` - Mounted filesystems
42 - `proc/diskstats` - Disk I/O statistics
43
444. **Process Information**:
45 - `sos_commands/process/ps_auxwww` - Process list with details
46 - `sos_commands/process/top` - Process snapshot (if available)
47 - `proc/[pid]/` - Per-process information
48
49## Implementation Steps
50
51### Step 1: Analyze Memory Usage
52
531. **Parse free command output**:
54 ```bash
55 # Check if free output exists
56 if [ -f sos_commands/memory/free ]; then
57 cat sos_commands/memory/free
58 fi
59 ```
60
612. **Extract memory metrics**:
62 ```bash
63 # Parse /proc/meminfo for detailed stats
64 if [ -f proc/meminfo ]; then
65 grep -E "^(MemTotal|MemFree|MemAvailable|Buffers|Cached|SwapTotal|SwapFree|Dirty|Slab):" proc/meminfo
66 fi
67 ```
68
693. **Calculate memory usage percentage**:
70 - Total memory = MemTotal
71 - Used memory = MemTotal - MemAvailable
72 - Usage percentage = (Used / Total) * 100
73 - Parse from `free` output or calculate from `meminfo`
74
754. **Check for memory pressure indicators**:
76 ```bash
77 # Look for OOM events in logs
78 grep -i "out of memory\|oom killer" sos_commands/logs/journalctl_--no-pager 2>/dev/null
79
80 # Check swap usage
81 if [ -f sos_commands/memory/swapon_-s ]; then
82 cat sos_commands/memory/swapon_-s
83 fi
84 ```
85
865. **Identify memory issues**:
87 - Memory usage > 90% → Critical
88 - Memory usage > 80% → Warning
89 - Heavy swap usage (>50% swap used) → Performance issue
90 - OOM killer events → Critical memory exhaustion
91
92### Step 2: Analyze CPU Usage
93
941. **Extract CPU information**:
95 ```bash
96 # Get CPU count and model
97 if [ -f sos_commands/processor/lscpu ]; then
98 grep -E "^(CPU\(s\)|Model name|Thread|Core|Socket|CPU MHz):" sos_commands/processor/lscpu
99 fi
100 ```
101
1022. **Check load averages**:
103 ```bash
104 # Parse uptime for load averages
105 if [ -f uptime ]; then
106 cat uptime
107 fi
108
109 # Or from proc/loadavg
110 if [ -f proc/loadavg ]; then
111 cat proc/loadavg
112 fi
113 ```
114
1153. **Interpret load averages**:
116 - Load average format: 1-min, 5-min, 15-min
117 - Compare with CPU count from lscpu
118 - Load > CPU count → System overloaded
119 - Load >> CPU count (2x or more) → Critical overload
120
1214. **Check for CPU throttling**:
122 ```bash
123 # Look for thermal throttling in logs
124 grep -i "throttl\|temperature\|thermal" sos_commands/logs/journalctl_--no-pager 2>/dev/null | head -20
125 ```
126
1275. **Identify CPU issues**:
128 - 1-min load > 2x CPU count → Critical
129 - 5-min load > CPU count → Warning
130 - Thermal throttling present → Hardware/cooling issue
131
132### Step 3: Analyze Disk Usage
133
1341. **Parse df output for filesystem usage**:
135 ```bash
136 if [ -f sos_commands/filesys/df_-al ]; then
137 # Skip header and special filesystems, show only regular filesystems
138 grep -v "^Filesystem\|tmpfs\|devtmpfs\|overlay" sos_commands/filesys/df_-al | grep -v "^$"
139 fi
140 ```
141
1422. **Identify full or nearly-full filesystems**:
143 ```bash
144 # Extract filesystems with usage > 85%
145 if [ -f sos_commands/filesys/df_-al ]; then
146 awk 'NR>1 && $5+0 >= 85 {print $5, $6, $1}' sos_commands/filesys/df_-al | grep -v "tmpfs\|devtmpfs"
147 fi
148 ```
149
1503. **Check disk I/O errors**:
151 ```bash
152 # Look for I/O errors in logs
153 grep -i "i/o error\|read error\|write error\|bad sector" var/log/dmesg 2>/dev/null
154 grep -i "i/o error\|read error\|write error" sos_commands/logs/journalctl_--no-pager 2>/dev/null | head -20
155 ```
156
1574. **Analyze block devices**:
158 ```bash
159 if [ -f sos_commands/block/lsblk ]; then
160 cat sos_commands/block/lsblk
161 fi
162 ```
163
1645. **Identify disk issues**:
165 - Filesystem > 95% full → Critical
166 - Filesystem > 85% full → Warning
167 - I/O errors present → Hardware issue
168 - Root filesystem full → System stability risk
169
170### Step 4: Analyze Process Information
171
1721. **Parse ps output**:
173 ```bash
174 if [ -f sos_commands/process/ps_auxwww ]; then
175 # Show header
176 head -1 sos_commands/process/ps_auxwww
177 fi
178 ```
179
1802. **Find top CPU consumers**:
181 ```bash
182 # Sort by CPU usage (column 3), show top 10
183 if [ -f sos_commands/process/ps_auxwww ]; then
184 tail -n +2 sos_commands/process/ps_auxwww | sort -k3 -rn | head -10
185 fi
186 ```
187
1883. **Find top memory consumers**:
189 ```bash
190 # Sort by memory usage (column 4), show top 10
191 if [ -f sos_commands/process/ps_auxwww ]; then
192 tail -n +2 sos_commands/process/ps_auxwww | sort -k4 -rn | head -10
193 fi
194 ```
195
1964. **Check for zombie processes**:
197 ```bash
198 # Look for processes in Z state
199 if [ -f sos_commands/process/ps_auxwww ]; then
200 grep " Z " sos_commands/process/ps_auxwww || echo "No zombie processes found"
201 fi
202 ```
203
2045. **Count processes by state**:
205 ```bash
206 # Count processes by state (R=running, S=sleeping, D=uninterruptible, Z=zombie, T=stopped)
207 if [ -f sos_commands/process/ps_auxwww ]; then
208 tail -n +2 sos_commands/process/ps_auxwww | awk '{print $8}' | cut -c1 | sort | uniq -c
209 fi
210 ```
211
2126. **Identify process issues**:
213 - Zombie processes present → Parent process not reaping children
214 - Many processes in D state → I/O bottleneck
215 - Single process using >80% memory → Memory leak or expected behavior
216 - Many processes using high CPU → CPU contention
217
218### Step 5: Correlate Resource Usage with Issues
219
2201. **Cross-reference with logs**:
221 - If high memory usage, check for OOM events in logs
222 - If high disk usage, check for disk full errors
223 - If high load, check for performance-related errors
224
2252. **Identify resource exhaustion patterns**:
226 - Memory exhaustion → OOM killer → Service crashes
227 - Disk full → Write failures → Application errors
228 - CPU overload → Timeouts → Request failures
229
2303. **Build timeline**:
231 - When did resource issues start?
232 - Correlate with log timestamps
233 - Identify triggering event if possible
234
235### Step 6: Generate Resource Analysis Summary
236
237Create a structured summary with the following sections:
238
2391. **Memory Summary**:
240 - Total memory
241 - Used memory (GB and %)
242 - Available memory
243 - Swap usage (GB and %)
244 - Memory pressure indicators (OOM events)
245
2462. **CPU Summary**:
247 - CPU count and model
248 - Load averages (1-min, 5-min, 15-min)
249 - Load per CPU
250 - CPU issues (throttling, overload)
251
2523. **Disk Summary**:
253 - Filesystems and usage percentages
254 - Full or nearly-full filesystems
255 - I/O errors count
256 - Most full filesystem
257
2584. **Process Summary**:
259 - Total process count
260 - Top CPU consumers (top 5)
261 - Top memory consumers (top 5)
262 - Zombie process count
263 - Processes in uninterruptible sleep (D state)
264
2655. **Critical Resource Issues**:
266 - List issues by severity
267 - Provide evidence (file paths, metrics)
268 - Suggest remediation
269
270## Error Handling
271
2721. **Missing resource files**:
273 - If `free` is missing, parse `proc/meminfo` directly
274 - If `ps` is missing, check `proc/` for process information
275 - Document missing data in summary
276
2772. **Parsing errors**:
278 - Handle different output formats (free -h vs free -m)
279 - Account for locale differences in number formats
280 - Validate data before calculations
281
2823. **Incomplete data**:
283 - Some sosreports may not include all resource files
284 - Indicate which metrics are unavailable
285 - Work with available data only
286
287## Output Format
288
289The resource analysis should produce:
290
291```bash
292RESOURCE USAGE SUMMARY
293======================
294
295MEMORY
296------
297Total: {total_gb} GB
298Used: {used_gb} GB ({used_pct}%)
299Available: {available_gb} GB ({available_pct}%)
300Buffers: {buffers_gb} GB
301Cached: {cached_gb} GB
302Swap Total: {swap_total_gb} GB
303Swap Used: {swap_used_gb} GB ({swap_used_pct}%)
304
305Status: {OK|WARNING|CRITICAL}
306Issues:
307 - {memory_issue_description}
308
309CPU
310---
311Model: {cpu_model}
312CPU Count: {cpu_count}
313Threads/Core: {threads_per_core}
314
315Load Averages: {load_1m}, {load_5m}, {load_15m}
316Load per CPU: {load_1m_per_cpu}, {load_5m_per_cpu}, {load_15m_per_cpu}
317
318Status: {OK|WARNING|CRITICAL}
319Issues:
320 - {cpu_issue_description}
321
322DISK USAGE
323----------
324Filesystem Size Used Avail Use% Mounted on
325{filesystem} {size} {used} {avail} {pct}% {mount}
326
327Nearly Full Filesystems (>85%):
328 - {mount}: {pct}% full ({available} available)
329
330I/O Errors: {count} errors found in logs
331
332Status: {OK|WARNING|CRITICAL}
333Issues:
334 - {disk_issue_description}
335
336PROCESSES
337---------
338Total Processes: {total}
339Running: {running}
340Sleeping: {sleeping}
341Zombie: {zombie}
342Uninterruptible: {uninterruptible}
343
344Top CPU Consumers:
345 1. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
346 2. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
347 3. {process_name} (PID {pid}): {cpu}% CPU, {mem}% MEM
348
349Top Memory Consumers:
350 1. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
351 2. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
352 3. {process_name} (PID {pid}): {mem}% MEM, {cpu}% CPU
353
354Status: {OK|WARNING|CRITICAL}
355Issues:
356 - {process_issue_description}
357
358CRITICAL RESOURCE ISSUES
359------------------------
360{severity}: {issue_description}
361 Evidence: {file_path}
362 Impact: {impact_description}
363 Recommendation: {remediation_action}
364
365RECOMMENDATIONS
366---------------
3671. {actionable_recommendation}
3682. {actionable_recommendation}
369
370DATA SOURCES
371------------
372- Memory: {sosreport_path}/sos_commands/memory/free
373- Memory: {sosreport_path}/proc/meminfo
374- CPU: {sosreport_path}/sos_commands/processor/lscpu
375- Load: {sosreport_path}/uptime
376- Disk: {sosreport_path}/sos_commands/filesys/df_-al
377- Processes: {sosreport_path}/sos_commands/process/ps_auxwww
378```
379
380## Examples
381
382### Example 1: Memory Analysis
383
384```bash
385# Parse free command output
386$ cat sos_commands/memory/free
387 total used free shared buff/cache available
388Mem: 16277396 8123456 2145678 123456 6008262 7654321
389Swap: 8388604 512000 7876604
390
391# Interpretation:
392# - Total RAM: ~16 GB
393# - Used: ~8 GB (50%)
394# - Available: ~7.6 GB (47%)
395# - Swap used: ~500 MB (6%)
396# Status: OK - healthy memory usage
397```
398
399### Example 2: Disk Full Detection
400
401```bash
402# Find filesystems > 85% full
403$ awk 'NR>1 && $5+0 >= 85' sos_commands/filesys/df_-al
404/dev/sda1 50G 45G 5G 90% /
405/dev/sdb1 100G 96G 4G 96% /var/log
406
407# Critical: Root filesystem at 90%, /var/log at 96%
408# Action required: Clean up disk space
409```
410
411### Example 3: High Load Investigation
412
413```bash
414# Check load averages
415$ cat uptime
41614:23:45 up 10 days, 3:42, 2 users, load average: 8.45, 7.23, 6.12
417
418# With lscpu showing 4 CPUs:
419# Load per CPU: 2.1, 1.8, 1.5
420# System is overloaded (load > 2x CPU count)
421```
422
423## Tips for Effective Analysis
424
4251. **Context matters**: High resource usage isn't always bad - consider the workload
4262. **Look for trends**: Compare 1-min, 5-min, 15-min loads to see if issues are growing
4273. **Correlate metrics**: High load + high memory + disk full = multiple issues
4284. **Check ratios**: Usage percentages are more meaningful than absolute values
4295. **Validate findings**: Cross-reference with log analysis for confirmation
4306. **Consider capacity**: Is the system appropriately sized for its workload?
431
432## Common Resource Patterns
433
4341. **Memory leak**: Steadily increasing memory usage, eventual OOM
4352. **Disk full**: Application writes failing, log rotation issues
4363. **CPU spike**: Load average spike, potentially from runaway process
4374. **I/O bottleneck**: High load but low CPU usage, many D-state processes
4385. **Swap thrashing**: High swap usage, poor performance
4396. **Zombie accumulation**: Parent process bug not reaping children
440
441## Severity Classification
442
443| Metric | OK | Warning | Critical |
444|--------|----|---------| ---------|
445| Memory Usage | < 80% | 80-90% | > 90% |
446| Swap Usage | < 20% | 20-50% | > 50% |
447| Disk Usage | < 85% | 85-95% | > 95% |
448| Load (per CPU) | < 1.0 | 1.0-2.0 | > 2.0 |
449| Root FS Usage | < 80% | 80-90% | > 90% |
450
451## See Also
452
453- Logs Analysis Skill: For finding resource-related errors in logs
454- System Configuration Analysis Skill: For investigating service resource limits
455- Network Analysis Skill: For network-related performance issues