2021-11-04 18:23:33

This commit is contained in:
gbaconni
2021-11-04 18:23:33 +01:00
parent c9c8ebdd77
commit 34614ed9cc
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # # By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2021/11/04 12:36:53 by gbaconni #+# #+# # # Created: 2021/11/04 12:36:53 by gbaconni #+# #+# #
# Updated: 2021/11/04 18:21:35 by gbaconni ### lausanne.ch # # Updated: 2021/11/04 18:23:28 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
@@ -31,12 +31,12 @@ ft_memory ()
ft_disk () ft_disk ()
{ {
df --total -Bm -T -l -x tmpfs -x devtmpfs \ df --total -Bm -T -l -x tmpfs -x devtmpfs \
| awk '/^total/ { total=int($3); used=int($4); pcent=int($6) } END { printf "#Disk Usage: %d/%dGb (%.2f%%)\n", used, total / 1000, pcent; }' | awk '/^total/ { total=int($3); used=int($4); pcent=int($6) } END { printf "#Disk Usage: %d/%dGb (%.0f%%)\n", used, total / 1000, pcent; }'
} }
ft_load () ft_load ()
{ {
top -b -n 1 | awk '/^%Cpu/ { usage=$2+$4; } END {printf "#CPU load: %d%%\n", usage; }' top -b -n 1 | awk '/^%Cpu/ { usage=$2+$4; } END {printf "#CPU load: %.1f%%\n", usage; }'
} }
ft_lastboot () ft_lastboot ()