-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.sh
28 lines (26 loc) · 1.65 KB
/
status.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# **************************************************************************** #
# #
# ::: :::::::: #
# status.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: agaley <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/06 22:27:29 by agaley #+# #+# #
# Updated: 2023/01/02 17:51:50 by agaley ### ########lyon.fr #
# #
# **************************************************************************** #
#!/bin/sh
wall <<EOF
#Architecture: $(uname -a)
#CPU physical: $(lscpu | grep '^CPU(s)' | awk '{ print $2 }')
#vCPU: $(awk '/cpu cores/{s+=$4} END {print s}' /proc/cpuinfo)
#Memory Usage: $(free -m | grep Mem | awk '{printf "%s/%sMB (%.2f%%)", $3,$2,$3*100/$2 }')
#Disk Usage: $(df -h | grep ' /$' | awk '{printf "%d/%s (%s)", $3,$2,$5}')
#CPU Load: $(top -bn1 | grep load | awk '{printf "%.2f%%\t\t\n", $(NF-2)}')
#Last boot: $(who -b | awk '{print $3" "$4" "$5}')
#LVM use: $(lsblk | grep lvm | wc -l | awk '{ print $0 ? "yes" : "no" }')
#Connection TCP: $(ss -t | grep ESTAB | wc -l) ESTABLISHED
#User log: $(who | awk '{print $1}' | sort -u | wc -l)
#Network: IP $(hostname -I | awk '{print $1}') ($(cat /sys/class/net/enp0s3/address))
#Sudo: $(grep 'COMMAND' /var/log/sudo/audit | wc -l) cmd
EOF