Lulzette b4b4ecbfd0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
beautiful
2022-01-13 04:46:30 +00:00

92 lines
1.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo -e "
__ __ __
/ /__ __ / /_ ___ / /___ ___ _____
/ __/ | /| / / ______ / __ \/ _ \/ / __ \/ _ \/ ___/
/ /_ | |/ |/ / /_____/ / / / / __/ / /_/ / __/ /
\__/ |__/|__/ /_/ /_/\___/_/ .___/\___/_/
/_/
"
trap 'echo " Vyhody cherez menu"' INT
# text color
TEXT_COLOR_GOOD="\033[92m"
TEXT_COLOR_BAD="\033[91m"
TEXT_COLOR_OFF="\033[0m"
harakiri() {
printf "${TEXT_COLOR_BAD}Committing *roskomnadzor*...${TEXT_COLOR_OFF}\n"
if [[ "$HOSTNAME" != "pve-ansible" ]]; then
rm -f "$BASH_SOURCE" &> /dev/null
fi
exit
}
echo "- Load:"
nproc=`nproc`
la=`cat /proc/loadavg | awk '{print $1, $2, $3}'`
usedmem=`free -m | head -2 | tail -1 | awk '{print $3}'`
totalmem=`free -m | head -2 | tail -1 | awk '{print $2}'`
echo 'LA: ' $la ' of ' $nproc
echo 'RAM: ' $usedmem 'Mb of ' $totalmem Mb
echo "- Disk:"
df -h | head -n 1
df -h | grep '/dev/vd'
echo "- Inodes:"
df -hi | grep '/dev/vd'
echo "- Installed panel:"
#if zero - false
[[ -d /opt/webdir/bin/ ]] && echo "Bitrix!"
[[ -d /usr/local/vesta/ ]] && echo "Vesta!"
[[ -d /usr/local/mgr5/ ]] && echo "ISPManager!"
[[ -d /usr/local/fastpanel2 ]] && echo "Fastpanel 2"
echo "- Installed packages"
list=$(apt list --installed 2>&1 |egrep 'atop')
echo $list
while true
do
echo -e "
---
1. Посмотреть жрущие ЦПУ/ОЗУ процессы
2. Вывести OOM'ы
0. Выход
"
read -r -p "Выбери: " action
case $action in
0)
harakiri
;;
1)
echo "- Top RAM usage:"
ps axk-%mem ouser,%cpu,%mem,command | head
echo
echo "- Top CPU usage:"
ps axk-%cpu ouser,%cpu,%mem,command | head
;;
2)
echo "- OOMS:"
dmesg -T | grep "Out of memory"
;;
esac
done