-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitor.sh.save.1
More file actions
executable file
·2 lines (2 loc) · 5.85 KB
/
monitor.sh.save.1
File metadata and controls
executable file
·2 lines (2 loc) · 5.85 KB
1
2
GNU nano 7.2 monitor.sh #!/bin/bash mkdir -p logs USER=$(whoami) HOST=$(hostname) DATE=$(date "+%Y-%m-%d_%H-%M-%S") LOG="logs/report_$DATE.txt" echo "===== System Monitoring Report =====" > $LOG echo "Generated by: $USER@$HOST on $(date)" >> $LOG echo "" >> $LOG # CPU PERFORMANCE echo ">> CPU Performance (mpstat):" >> $LOG mpstat 1 3 >> $LOG echo "" >> $LOG # CPU TEMPERATURE # echo ">> CPU Temperature (sensors):"
GNU nano 7.2 monitor.sh #!/bin/bash mkdir -p logs USER=$(whoami) HOST=$(hostname) DATE=$(date "+%Y-%m-%d_%H-%M-%S") LOG="logs/report_$DATE.txt" echo "===== System Monitoring Report =====" > $LOG echo "Generated by: $USER@$HOST on $(date)" >> $LOG echo "" >> $LOG # CPU PERFORMANCE echo ">> CPU Performance (mpstat):" >> $LOG mpstat 1 3 >> $LOG echo "" >> $LOG # CPU TEMPERATURE # echo ">> CPU Temperature (sensors):" # if command -v sensors &> /dev/null; then # sensors 2>/dev/null || echo " [CPU temperature data not available in this environment]" # else