Lulzette e7513a4060
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Fix colors
2022-01-13 05:14:30 +00:00

96 lines
2.1 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
trap 'echo " Vyhody cherez menu"' INT
TEXT_COLOR_GOOD="\033[92m"
TEXT_COLOR_BAD="\033[91m"
TEXT_COLOR_OFF="\033[0m"
echo -e "
${TEXT_COLOR_GOOD}
__ __ __
/ /__ __ / /_ ___ / /___ ___ _____
/ __/ | /| / / ______ / __ \/ _ \/ / __ \/ _ \/ ___/
/ /_ | |/ |/ / /_____/ / / / / __/ / /_/ / __/ /
\__/ |__/|__/ /_/ /_/\___/_/ .___/\___/_/
/_/
${TEXT_COLOR_OFF}
"
harakiri() {
printf "${TEXT_COLOR_BAD}Committing *roskomnadzor*...${TEXT_COLOR_OFF}\n"
if [[ "$HOSTNAME" != "pve-ansible" ]]; then
rm -f "$BASH_SOURCE" &> /dev/null
fi
exit
}
lsb_release -a 2> /dev/null
echo -e "\n${TEXT_COLOR_GOOD} - Load:${TEXT_COLOR_OFF}\n"
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 -e "${TEXT_COLOR_GOOD} - Disk: ${TEXT_COLOR_OFF}\n"
df -h | head -n 1
df -h | grep '/dev/vd'
echo "- Inodes:"
df -hi | grep '/dev/vd'
echo -e "${TEXT_COLOR_GOOD} - Installed panel: ${TEXT_COLOR_OFF}\n"
#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 -e "${TEXT_COLOR_GOOD} - Installed packages: ${TEXT_COLOR_OFF}\n"
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