diff --git a/bin/v-list-sys-cpu-status b/bin/v-list-sys-cpu-status new file mode 100755 index 000000000..fa925f8b5 --- /dev/null +++ b/bin/v-list-sys-cpu-status @@ -0,0 +1,42 @@ +#!/bin/bash +# info: list system cpu info +# options: [FORMAT] +# +# The function lists cpu information + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Displaying top 30 +top -b -n1 | head -n 37 +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying process tree +pstree -s +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying CPU information +grep 'model name' /proc/cpuinfo|cut -f 2 -d : | sed "s/ //" +echo +lscpu 2>/dev/null + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-db-status b/bin/v-list-sys-db-status new file mode 100755 index 000000000..755ff5c40 --- /dev/null +++ b/bin/v-list-sys-db-status @@ -0,0 +1,83 @@ +#!/bin/bash +# info: list db status +# options: [FORMAT] +# +# The function lists db server status + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Checking db system +if [ -z "$DB_SYSTEM" ]; then + exit +fi + +# Checking supported database systems +for db in $(echo $DB_SYSTEM| tr ',' '\n'); do + OLD_IFS="$IFS" + IFS=$'\n' + + # Checking database config + if [ -e "$VESTA/conf/$db.conf" ]; then + + # Checking server status + for host_str in $(cat $VESTA/conf/$db.conf); do + eval $host_str + + # Checking MySQL + if [ "$db" = 'mysql' ]; then + mycnf="$VESTA/conf/.mysql.$HOST" + if [ ! -e "$mycnf" ]; then + echo "[client]">$mycnf + echo "host='$HOST'" >> $mycnf + echo "user='$USER'" >> $mycnf + echo "password='$PASSWORD'" >> $mycnf + chmod 600 $mycnf + else + mypw=$(grep password $mycnf|cut -f 2 -d \') + if [ "$mypw" != "$PASSWORD" ]; then + echo "[client]">$mycnf + echo "host='$HOST'" >> $mycnf + echo "user='$USER'" >> $mycnf + echo "password='$PASSWORD'" >> $mycnf + chmod 660 $mycnf + fi + fi + echo "MySQL $HOST status" + mysqladmin --defaults-file=$mycnf status |sed -e "s/ /\n/g" + echo + mysqladmin --defaults-file=$mycnf processlist + echo -en "\n-------------------------------------" + echo -en "-------------------------------------\n\n" + fi + + # Checking PostgreSQL + if [ "$db" = 'pgsql' ]; then + echo "PostgreSQL $HOST status" + export PGPASSWORD="$PASSWORD" + psql -h $HOST -U $USER -c "SELECT * FROM pg_stat_activity" + fi + done + fi + IFS="$OLD_IFS" +done + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-disk-status b/bin/v-list-sys-disk-status new file mode 100755 index 000000000..c8b50f856 --- /dev/null +++ b/bin/v-list-sys-disk-status @@ -0,0 +1,40 @@ +#!/bin/bash +# info: list disk information +# options: [FORMAT] +# +# The function lists disk information + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Displaying disk usage +df -h +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying I/O usage +iostat -m +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying disk information +fdisk -l + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-dns-status b/bin/v-list-sys-dns-status new file mode 100755 index 000000000..d39cd40a7 --- /dev/null +++ b/bin/v-list-sys-dns-status @@ -0,0 +1,75 @@ +#!/bin/bash +# info: list dns status +# options: [FORMAT] +# +# The function lists dns server status + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Checking dns system +if [ -z "$DNS_SYSTEM" ]; then + exit +fi + +# Checking statistics-file on RHEL/CentOS +if [ -e "/etc/named/named.conf" ]; then + conf="/etc/named/named.conf" + dump_file='/var/named/data/named_stats.txt' + dump_option=" dump-file \"$dump_file\";" + opt_check=$(grep $dump_file $conf |grep -v //) + if [ -z "$opt_check" ]; then + sed -i "s|options {|options {\n$dump_option|" $conf + service named restart >/dev/null 2>&1 + fi +fi +if [ -e "/etc/named.conf" ]; then + conf="/etc/named.conf" + dump_file='/var/named/data/named_stats.txt' + dump_option=" dump-file \"$dump_file\";" + opt_check=$(grep $dump_file $conf |grep -v //) + if [ -z "$opt_check" ]; then + sed -i "s|options {|options {\n$dump_option|" $conf + service named restart >/dev/null 2>&1 + fi +fi + +# Checking statistics-file on Debian/Ubuntu +if [ -e "/etc/bind/named.conf" ]; then + conf="/etc/bind/named.conf.options" + dump_file='/var/cache/bind/named.stats' + #dump_option=" dump-file \"$dump_file\";" + #opt_check=$(grep $dump_file $conf |grep -v //) + #if [ -z "$opt_check" ]; then + # sed -i "s|options {|options {\n$dump_option|" $conf + # service named restart >/dev/null 2>&1 + #fi +fi + +# Generating dns stats +rm -f $dump_file 2>/dev/null +/usr/sbin/rndc stats 2>/dev/null + +# Displaying dns status +if [ -e "$dump_file" ]; then + cat $dump_file +fi + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-mail-status b/bin/v-list-sys-mail-status new file mode 100755 index 000000000..802f24bec --- /dev/null +++ b/bin/v-list-sys-mail-status @@ -0,0 +1,46 @@ +#!/bin/bash +# info: list mail status +# options: [FORMAT] +# +# The function lists mail server status + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Checking mail system +if [ -z "$MAIL_SYSTEM" ]; then + exit +fi + +# Displaying exim queue status +echo "Exim queue status" +exim -bp +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying exim stats +if [ -e "/var/log/exim4/mainlog" ]; then + eximstats /var/log/exim4/mainlog 2>/dev/null +else + eximstats /var/log/exim/main.log 2>/dev/null +fi + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-memory-status b/bin/v-list-sys-memory-status new file mode 100755 index 000000000..f6a8e0773 --- /dev/null +++ b/bin/v-list-sys-memory-status @@ -0,0 +1,40 @@ +#!/bin/bash +# info: list virtual memory info +# options: [FORMAT] +# +# The function lists virtual memory information + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Displaying memory and swap usage +free -t -m +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying memory stats +vmstat -S m -s +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying ram information +dmidecode -t 17 2>/dev/null + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-network-status b/bin/v-list-sys-network-status new file mode 100755 index 000000000..2050da575 --- /dev/null +++ b/bin/v-list-sys-network-status @@ -0,0 +1,40 @@ +#!/bin/bash +# info: list system network status +# options: [FORMAT] +# +# The function lists network status + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Displaying network stats +ss -s +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying network usage +lsof -itcp -n -P +echo -en "\n-------------------------------------" +echo -en "-------------------------------------\n\n" + +# Displaying network interfaces +ifconfig + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-list-sys-web-status b/bin/v-list-sys-web-status new file mode 100755 index 000000000..b243437a4 --- /dev/null +++ b/bin/v-list-sys-web-status @@ -0,0 +1,49 @@ +#!/bin/bash +# info: list web status +# options: [FORMAT] +# +# The function lists web server status + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +#format=${1-shell} + +# Includes +#source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Checking web system +if [ -z "$WEB_SYSTEM" ]; then + exit +fi + +# Displaying proxy status +if [ "$PROXY_SYSTEM" = 'nginx' ]; then + echo "