Loadwatch

Loadwatch Parsing

 (echo; read -p "loadwatch filename: " LWFN; echo -e "\nCPU MEM PID\tPROCESS" ;awk '/PID %CPU %MEM/,/## mysql stats/' ~/loadwatch/$LWFN | grep -v "## mysql stats" | awk '{print $3,$4,$2"\t"substr($0,index($0,$11))}' | sort -nr | head;echo -e "\nCPU %\tIP\t\tDOMAIN\t\t\t\t   REQUEST"; awk '/   Srv   PID     Acc/,/     _______/'  ~/loadwatch/$LWFN | grep -v "     _______" | awk '{printf "%-8s%-16s%-35s%s\n",$5,$12,$14,substr($0,index($0,$15))}' | egrep "(GET|POST)" | grep -v "0.00"  | sort -nr)