From c62ccb1925eed97f0d9f792f13c81d8c6469ea11 Mon Sep 17 00:00:00 2001 From: wilou Date: Thu, 16 Mar 2023 08:02:16 +0000 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'dcon?= =?UTF-8?q?f'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dconf/cpu.sh | 8 ++++++++ dconf/monitor.sh | 9 +++++++++ dconf/ram.sh | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 dconf/cpu.sh create mode 100644 dconf/monitor.sh create mode 100644 dconf/ram.sh diff --git a/dconf/cpu.sh b/dconf/cpu.sh new file mode 100644 index 0000000..19359cc --- /dev/null +++ b/dconf/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/dconf/monitor.sh b/dconf/monitor.sh new file mode 100644 index 0000000..10e5a24 --- /dev/null +++ b/dconf/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/dconf/ram.sh b/dconf/ram.sh new file mode 100644 index 0000000..e7c7ae6 --- /dev/null +++ b/dconf/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"