first commit

This commit is contained in:
Erreur32 2020-04-13 16:42:16 +02:00
parent b2d207e5ae
commit 999d9779d5

23
Stats32
View file

@ -26,19 +26,6 @@ if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
fi
nbconnected="$(users | wc -w)"
#echo -e " Kernel Info [ $DISTRIB_DESCRIPTION ]"
#echo -e " Shell [ $SHELL ]"
#echo -e " Last SSH [ $(tput setab 1) $(users | wc -w) $(tput sgr0) connected ]"
#printf "%s-----------\t---\t------------\t----------\n"
#printf " Kernel Info :\t%s\t \t%s\t IP Address:\t%s\n" $DISTRIB_DESCRIPTION $ip
#printf " Shell :\t%s\tSystem uptime:\t%s\n" $SHELL "$time"
#printf " Last SSH :\t%s\tSwap usage:\t%s\n" "$(tput setab 1) $(users | wc -w) $(tput sgr0) connected"
#echo -e "\e[1;30m" ; last -a -n $nbconnected | grep pts ; echo -e "\e[0m"
sys_load_c="$(tput setab 34)$(tput setaf 0)"
usage_color="$(tput setaf 202)"
ssh_c="$(tput setab 124)"
NC="$(tput sgr0)"
load=`cat /proc/loadavg | awk '{print $1}'`
root_usage=`df -h / | awk '/\// {print $(NF-1)}'`
@ -52,11 +39,11 @@ ip=`hostname -i`
# ip=`hostname -i | awk '{ printf $2 }'`
printf "Kernel Info [ $DISTRIB_DESCRIPTION ]\n"
printf "%s------------\t---\t-------------\t----------\n"
printf "System load :\t%s\tIP Address :\t%s\n" "${sys_load_c} $load ${NC}" $ip
printf "Memory usage :\t%s\tSystem uptime:\t%s\n" $memory_usage "$time"
printf "Usage on / :\t%s\tenv LANGAUAGE:\t%s\n" "${usage_color}$root_usage ${NC}" "$(env | grep LANG=)"
printf "Swap usage :\t%s\tProcesses :\t%s\n" $swap_usage $processes
printf "User SSH :\t%s\tShell :\t%s\n" "${ssh_c} $(users | wc -w) ${NC}" $SHELL
printf "System load :\e[42;30;1m\t%s\e[0;0m\tIP Address :\t%s\n" " $load " $ip
printf "Memory usage :\e[46;3m\e[30;1m\t%s\e[0;0m\tSystem uptime:\t%s\n" " $memory_usage " "$time"
printf "Usage on / :\e[46;3m\e[30m\t%s\e[0;0m\tenv LANGAUAGE:\t%s\n" " $root_usage " "$(env | grep LANG=)"
printf "Swap usage :\e[46;3m\e[30m\t%s\e[0;0m\tProcesses :\t%s\n" " $swap_usage " $processes
printf "User SSH :\e[41m\e[1m\t%s\e[0;0m\tShell :\t%s\n" " $(users | wc -w) " $SHELL
printf "%s------------\t---\t-------------\t----------\n"
echo -e "\n Conected Users $(users | wc -w) \e[1;30m" ; [[ -z "$nbconnected" ]] && last -a -n $nbconnected | grep pts | head -3 || last -a -n $nbconnected | grep pts