Skip to content

Instantly share code, notes, and snippets.

@orrymr
Created October 23, 2024 19:59
Show Gist options
  • Save orrymr/abba52038b0a678fe22f204d95c76c64 to your computer and use it in GitHub Desktop.
Save orrymr/abba52038b0a678fe22f204d95c76c64 to your computer and use it in GitHub Desktop.
CPU Utilization Tool
#!/bin/bash
display_cpu_util() {
while true; do
cpu_util=$(sar -u 1 1 | awk '/^Average:.*all/ {print 100-$NF}')
dialog --title "CPU Utilization" --infobox "CPU Utilization: $cpu_util %" 5 40
done
}
display_cpu_util
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment