-
Notifications
You must be signed in to change notification settings - Fork 0
/
irscript-2-system-resource.sh
27 lines (24 loc) · 1.05 KB
/
irscript-2-system-resource.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#resultfile
output_file="Incident_Report_System_Resources_$(date +%Y-%m-%d-%H-%M-%S).txt"
echo "Date & Time of Report - $(date +%Y-%m-%d-%H-%M-%S)"
#List of System Resources
echo "====================== System Resources Report =====================" >> "$output_file"
echo " " >> "$output_file"
echo "============= Linux System Tasks ============" >> "$output_file"
top >> "$output_file"
echo "" >> "$output_file"
echo "============= System uptime ============" >> "$output_file"
uptime >> "$output_file"
echo "" >> "$output_file"
echo "============= Currently Running Processes ============" >> "$output_file"
ps aux >> "$output_file"
echo "" >> "$output_file"
echo "============= Memory Usage in MB ============" >> "$output_file"
free -m >> "$output_file"
echo ""
echo "============= Display mounted File System ============" >> "$output_file"
cat /proc/mounts >> "$output_file"
echo ""
echo "====================== System Resources Report =====================" >> "$output_file"
echo "System & Processes resources Incident Report is saved to $output_file"