Mini Shell

Direktori : /proc/self/root/opt/sharedrads/
Upload File :
Current File : //proc/self/root/opt/sharedrads/check_misc

#!/bin/bash

function separatorbar {
	echo "========================================================================================="
}

echo;echo "Checking for Running Backups, gzip, and tar processes"
separatorbar
ps auwx | egrep "tar |gzip |cpbackup|gtar" | grep -v grep

echo;echo "Checking for File Transfers"
separatorbar
ps auwx | egrep "rsync |scp |wget |lynx |curl" |grep -vE "grep|root@10.127"

echo;echo "Checking FTP Traffic (look for multiple transfer with high Kb/Mb/sec)"
separatorbar
pure-ftpwho -Hs|grep -v old/oldIDLE|awk -F"|" {'print $12"kb/s\t"$2"\t"$4" FILE: "$5'}|sort -nk1

echo;echo "Checking most expensive processes"
separatorbar
ps auxw |sort -r -nk3|head -5

echo;echo "Checking for hung processes (excludes imap, gam_server, potentially includes http)"
separatorbar
ps auwx | awk '{if($1 ~ /[a-z]+[0-9]+/ &&  $9 ~ /[A-Z]+.*/ )print }' | egrep -v "gam_server|/usr/lib/courier-imap/bin/imapd"
if [ -f /etc/cpanel/ea4/is_ea4 ]; then
    ps auwx | awk '{if($1 ~ /nobody/ &&  $9 ~ /[A-Z]+.*/ && ! $11 == "/usr/sbin/httpd" )print }' | egrep -v "gam_server|/usr/lib/courier-imap/bin/imapd"
else
    ps auwx | awk '{if($1 ~ /nobody/ &&  $9 ~ /[A-Z]+.*/ && ! $11 == "/usr/local/apache/bin/httpd" )print }' | egrep -v "gam_server|/usr/lib/courier-imap/bin/imapd"
fi

echo
echo " Highest CPU consuming httpd process and its child processes"
separatorbar
ps aux | grep httpd | sort -nk3 | awk '{print $2}' | tail -1 | xargs -i awk '/{}/ {f=NR} f && NR==f+2' <(check_apache --statusfull)

Zerion Mini Shell 1.0