From 84cbf081b698edd933d3139e6e436bd94126e16e Mon Sep 17 00:00:00 2001 From: mgrl39 Date: Mon, 12 Aug 2024 19:55:19 +0200 Subject: [PATCH] Update 2024-06-06-script.md --- _posts/2024-06-06-script.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/_posts/2024-06-06-script.md b/_posts/2024-06-06-script.md index c3ee772..600915f 100644 --- a/_posts/2024-06-06-script.md +++ b/_posts/2024-06-06-script.md @@ -19,45 +19,34 @@ vim monitoring.sh #!/bin/bash ``` ```sh -# Architecture arch=$(uname -a) -# CPU Info cpuf=$(lscpu | awk '/Socket\(s\):/ {print $2}') cpuv=$(lscpu | awk '/^CPU\(s\):/ {print $2}') -# RAM Info ram_total=$(free -m | awk '/Mem:/ {print $2}') ram_use=$(free -m | awk '/Mem:/ {print $3}') ram_percent=$(free -m | awk '/Mem:/ {printf("%.2f"), $3/$2*100}') -# Disk Info disk_total=$(df -h --total | awk '/^total/ {print $2}') disk_use=$(df -h --total | awk '/^total/ {print $3}') disk_percent=$(df -h --total | awk '/^total/ {print $5}') -# CPU Load cpu1=$(vmstat 1 2 | tail -1 | awk '{printf $15}') cpu_op=$(expr 100 - $cpu1) cpu_fin=$(printf "%.1f" $cpu_op) -# Last Boot last_boot=$(who -b | awk '{print $3, $4}') -# LVM Usage lvmu=$(lsblk | grep -q "lvm" && echo "yes" || echo "no") -# TCP Connections tcp_conn=$(ss -tan | grep -c ESTAB) -# Logged Users user_log=$(who | wc -l) -# Network Info ip=$(hostname -I) mac=$(ip link show | awk '/link\/ether/ {print $2}') -# Sudo Commands sudo_cmd=$(journalctl _COMM=sudo | grep COMMAND | wc -l) wall " Architecture: $arch