Lulzette 3829104b72
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Menu
2022-01-13 04:13:34 +00:00

80 lines
1.5 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 "
__ __ __
/ /__ __ / /_ ___ / /___ ___ _____
/ __/ | /| / / ______ / __ \/ _ \/ / __ \/ _ \/ ___/
/ /_ | |/ |/ / /_____/ / / / / __/ / /_/ / __/ /
\__/ |__/|__/ /_/ /_/\___/_/ .___/\___/_/
/_/
"
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 ' of ' $totalmem
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)
exit ;;
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