From 7e14c929017e141dae64ee1de1cf630aaa338d98 Mon Sep 17 00:00:00 2001 From: wilou Date: Sat, 25 Feb 2023 17:46:01 +0000 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'mate?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mate/cpu.sh | 8 ++++++++ mate/monitor.sh | 9 +++++++++ mate/ram.sh | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 mate/cpu.sh create mode 100644 mate/monitor.sh create mode 100644 mate/ram.sh 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"