diff --git a/mate/cpu.sh b/mate/cpu.sh new file mode 100644 index 0000000..19359cc --- /dev/null +++ b/mate/cpu.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This script monitors CPU usage + + # Get the current usage of CPU + cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}') + + # Print the usage + echo "CPU: $cpuUsage%" diff --git a/mate/monitor.sh b/mate/monitor.sh new file mode 100644 index 0000000..10e5a24 --- /dev/null +++ b/mate/monitor.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# This script monitors CPU and memory usage + + # Get the current usage of CPU and memory + cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}') + memUsage=$(free -m | awk '/Mem/{print $3}') + + # Print the usage + echo "CPU : $cpuUsage% - RAM : $memUsage MB" diff --git a/mate/ram.sh b/mate/ram.sh new file mode 100644 index 0000000..e7c7ae6 --- /dev/null +++ b/mate/ram.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This script monitors memory usage + + # Get the current usage of memory + memUsage=$(free -m | awk '/Mem/{print $3}') + + # Print the usage + echo "RAM: $memUsage MB"